Introduction

Methods

Packages

library(tidyverse)
## Loading tidyverse: ggplot2
## Loading tidyverse: tibble
## Loading tidyverse: tidyr
## Loading tidyverse: readr
## Loading tidyverse: purrr
## Loading tidyverse: dplyr
## Warning: package 'ggplot2' was built under R version 3.4.4
## Warning: package 'tibble' was built under R version 3.4.4
## Warning: package 'tidyr' was built under R version 3.4.4
## Warning: package 'dplyr' was built under R version 3.4.4
## Conflicts with tidy packages ----------------------------------------------
## filter(): dplyr, stats
## lag():    dplyr, stats
library(plotrix)
## Warning: package 'plotrix' was built under R version 3.4.4
library(car)
## 
## Attaching package: 'car'
## The following object is masked from 'package:dplyr':
## 
##     recode
## The following object is masked from 'package:purrr':
## 
##     some
library(ggpubr)
## Loading required package: magrittr
## 
## Attaching package: 'magrittr'
## The following object is masked from 'package:purrr':
## 
##     set_names
## The following object is masked from 'package:tidyr':
## 
##     extract

Biomass Measurements

biomass <- read.csv("~/Documents/LabStats/Clusia/GrowthMeasurements.csv", header = TRUE, stringsAsFactors = TRUE, na.strings = "NA")
biomass <- biomass %>% 
  arrange(Condition, Treatment, SampleNumber)
## Warning: package 'bindrcpp' was built under R version 3.4.4

Controls

No difference between Control plants and plants that were inoculated with autoclaved bacteria (Control Mock). Confirms that the inoculation process itself does not account for changes between control plants and sample plants.

controls <- biomass %>% 
  filter(Treatment == "Control" | Treatment == "Control Mock")

Soil water

soilwater.control <- aov(SoilWater ~ Condition * Treatment, data = controls)
summary(soilwater.control) # no difference between control and control mock 
##                     Df Sum Sq Mean Sq F value   Pr(>F)    
## Condition            1  15410   15410  52.400 1.98e-06 ***
## Treatment            1     63      63   0.214    0.650    
## Condition:Treatment  1    156     156   0.531    0.477    
## Residuals           16   4705     294                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Total Dry Mass

totaldrywt.control <- aov(Total_DryWt ~ Condition * Treatment, data = controls)
summary(totaldrywt.control) # no difference between control and control mock 
##                     Df Sum Sq Mean Sq F value  Pr(>F)   
## Condition            1   3061  3060.8   9.789 0.00648 **
## Treatment            1      2     1.5   0.005 0.94548   
## Condition:Treatment  1     70    70.4   0.225 0.64152   
## Residuals           16   5003   312.7                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Root biomass

rootbiomass.control <- aov(RootBiomass ~ Condition * Treatment, data = controls)
summary(rootbiomass.control) # no difference between control and control mock
##                     Df Sum Sq Mean Sq F value  Pr(>F)   
## Condition            1 1860.3  1860.3   9.699 0.00668 **
## Treatment            1   60.7    60.7   0.316 0.58159   
## Condition:Treatment  1   31.9    31.9   0.166 0.68876   
## Residuals           16 3068.8   191.8                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Root:Shoot

rootshoot.control <- aov(RootShoot ~ Condition * Treatment, data = controls)
summary(rootshoot.control) # slight interaction term, but negligible
##                     Df Sum Sq Mean Sq F value Pr(>F)  
## Condition            1  4.381   4.381   3.181 0.0935 .
## Treatment            1  3.621   3.621   2.629 0.1244  
## Condition:Treatment  1  8.276   8.276   6.010 0.0261 *
## Residuals           16 22.031   1.377                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

RMF

rmf.control <- aov(RMF ~ Condition * Treatment, data = controls)
summary(rmf.control)
##                     Df  Sum Sq Mean Sq F value Pr(>F)  
## Condition            1 0.00920 0.00920   1.636 0.2191  
## Treatment            1 0.00588 0.00588   1.045 0.3220  
## Condition:Treatment  1 0.03466 0.03466   6.161 0.0245 *
## Residuals           16 0.09000 0.00563                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# removing control mock
biomass <- biomass %>%
  filter(Treatment != "Control Mock")

Summary Stats

biomass.sum <- biomass %>% 
  group_by(Condition) %>% 
  summarise_at(c("PotWt", "Leaf_FreshWt", "SoilWater", "Total_DryWt", "RootBiomass", "RootShoot", "RMF"), funs(mean, sd, std.error))
View(biomass.sum)

biomass.sum2 <- biomass %>% 
  group_by(Condition, Treatment) %>% 
  summarise_at(c("PotWt", "Leaf_FreshWt", "SoilWater", "Total_DryWt", "RootBiomass", "RootShoot", "RMF"), funs(mean, sd, std.error))
View(biomass.sum2)

Boxplots

Total Biomass

mytheme <- theme_bw() + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank())

ggplot(data = biomass, aes(x = Treatment, y = Total_DryWt, fill = Condition)) + geom_boxplot() + mytheme + scale_fill_manual(values=c("indianred3", "cadetblue3"), breaks=c("Well-watered", "Drought"),labels=c("Well-watered", "Drought")) + theme(legend.position = c(0.1, 0.85)) + ylab("Biomass (g DW)") + xlab("Constructed Community") + scale_x_discrete(limits = c("Control", "Nonfunctional Isolates", "Drought Isolates", "Phosphorus Isolates", "All Isolates"))

Root biomass

ggplot(data = biomass, aes(x = Treatment, y = RootBiomass, fill = Condition)) + geom_boxplot() + mytheme + scale_fill_manual(values=c("indianred3", "cadetblue3"), breaks=c("Well-watered", "Drought"),labels=c("Well-watered", "Drought")) + theme(legend.position = c(0.1, 0.85)) + ylab("Root Biomass (g DW)") + xlab("Constructed Community") + scale_x_discrete(limits = c("Control", "Nonfunctional Isolates", "Drought Isolates", "Phosphorus Isolates", "All Isolates"))

Possible trend in both total biomass and root biomass is that both Drought and Phosphorus communities have consistently higher means than the control, nonfunctional isolates, and all isolates plants. Although not statistically significant, they suggest that there may be an advantage to the plants to have specifically these specialized constructed communities during drought conditions.

Root:Shoot

ggplot(data = biomass, aes(x = Treatment, y = RootShoot, fill = Condition)) + geom_boxplot() + mytheme + scale_fill_manual(values=c("indianred3", "cadetblue3"), breaks=c("Well-watered", "Drought"),labels=c("Well-watered", "Drought")) + theme(legend.position = c(0.1, 0.85)) + ylab("Root : Shoot") + xlab("Constructed Community") + scale_x_discrete(limits = c("Control", "Nonfunctional Isolates", "Drought Isolates", "Phosphorus Isolates", "All Isolates"))

Root Mass Fraction

ggplot(data = biomass, aes(x = Treatment, y = RMF, fill = Condition)) + geom_boxplot() + mytheme + scale_fill_manual(values=c("indianred3", "cadetblue3"), breaks=c("Well-watered", "Drought"),labels=c("Well-watered", "Drought")) + theme(legend.position = c(0.1, 0.85)) + ylab("Root Mass Fraction") + xlab("Constructed Community") + scale_x_discrete(limits = c("Control", "Nonfunctional Isolates", "Drought Isolates", "Phosphorus Isolates", "All Isolates"))

ANOVAs

Soil Water

soilwater.aov <- aov(SoilWater ~ Condition*Treatment, data = biomass)
summary(soilwater.aov) 
##                     Df Sum Sq Mean Sq F value Pr(>F)    
## Condition            1  55623   55623 222.891 <2e-16 ***
## Treatment            4   1150     287   1.152  0.341    
## Condition:Treatment  4   1570     393   1.573  0.193    
## Residuals           60  14973     250                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# homogeneity of variance
plot(soilwater.aov, 1) 

leveneTest(SoilWater ~ Condition*Treatment, data = biomass) 
# testing normality
plot(soilwater.aov, 2)

water.residuals <- residuals(object = soilwater.aov)
shapiro.test(x = water.residuals) 
## 
##  Shapiro-Wilk normality test
## 
## data:  water.residuals
## W = 0.83065, p-value = 1.721e-07
ggplot(data = biomass, aes(x = Treatment, y = SoilWater)) + geom_boxplot() + facet_grid(. ~ Condition) + mytheme

Total Dry Mass

# density histogram
ggplot(data = biomass, aes(x = Total_DryWt)) + geom_histogram(aes(y=..density..), binwidth = 15, color="black", fill="gray") + geom_density(alpha = 0.2, fill = "#FF6666") + theme_classic() + xlab("Biomass (g DW)") + ylab("Density") + mytheme + ggtitle("Total Dry Mass Density Histogram")

# histogram by Condition (water treatment)
mu <- biomass %>% 
  group_by(Condition) %>% 
  summarise(mean = mean(Total_DryWt))

ggplot(data = biomass, aes(x = Total_DryWt, fill = Condition)) + geom_histogram(binwidth = 15, position = "identity", alpha = 0.5) + geom_vline(data = mu, aes(xintercept=mean, color=Condition), linetype="dashed") + scale_color_manual(values=c("indianred3", "cadetblue3")) + theme_classic() + xlab("Biomass (g DW)") + ylab("Count") + theme(legend.position = c(0.9, 0.9)) + ggtitle("Total Dry Mass Histogram")

totaldrywt.aov <- aov(Total_DryWt ~ Condition*Treatment, data = biomass)
summary(totaldrywt.aov) 
##                     Df Sum Sq Mean Sq F value   Pr(>F)    
## Condition            1  18863   18863  32.100 4.41e-07 ***
## Treatment            4   1734     433   0.738    0.570    
## Condition:Treatment  4   1757     439   0.747    0.564    
## Residuals           60  35258     588                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# homogeneity of variance
plot(totaldrywt.aov, 1)

leveneTest(Total_DryWt ~ Condition*Treatment, data = biomass) 
# testing normality
plot(totaldrywt.aov, 2)

totaldrywt.residuals <- residuals(object = totaldrywt.aov)
shapiro.test(x = totaldrywt.residuals) 
## 
##  Shapiro-Wilk normality test
## 
## data:  totaldrywt.residuals
## W = 0.87475, p-value = 4.465e-06
# identifying outliers
mod <- lm(Total_DryWt ~ Condition, data = biomass)
cooksd <- cooks.distance(mod)

plot(cooksd, pch="*", cex = 2, main = "Influential Obs in Total Dry Mass by Cooks Distance")
abline(h = 4*mean(cooksd, na.rm = T), col = "red")
text(x = 1: length(cooksd)+1, y = cooksd, labels = ifelse(cooksd>4*mean(cooksd, na.rm = T), names(cooksd), ""), col = "red")

# identifying rows with the outliers
biomass.out <- as.numeric(names(cooksd)[(cooksd > 4*mean(cooksd, na.rm = T))])

# removing outliers and testing impact
biomass <- biomass[-c(67,72), ]

ggqqplot(biomass$Total_DryWt)

shapiro.test(biomass$Total_DryWt) # completely normal
## 
##  Shapiro-Wilk normality test
## 
## data:  biomass$Total_DryWt
## W = 0.84597, p-value = 5.813e-07
# biomass total dry weight is now normal.
# rerunning biomass anova with removed outliers
totaldrywt.aov <- aov(Total_DryWt ~ Condition*Treatment, data = biomass)
summary(totaldrywt.aov) # same conclusion
##                     Df Sum Sq Mean Sq F value   Pr(>F)    
## Condition            1  18731   18731  31.346 5.93e-07 ***
## Treatment            4   1761     440   0.737    0.571    
## Condition:Treatment  4   1714     429   0.717    0.584    
## Residuals           59  35256     598                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Root Biomass

# density histogram
ggplot(data = biomass, aes(x = RootBiomass)) + geom_histogram(binwidth = 8, aes(y =..density..), colour = "black", fill = "white") + geom_density(alpha = 0.2, fill = "#FF6666") + mytheme + ggtitle("Root Biomass Density Diagram")

# by water treatment
mu2 <- biomass %>% 
  group_by(Condition) %>% 
  summarise(mean = mean(RootBiomass))

ggplot(data = biomass, aes(x = RootBiomass, fill = Condition)) + geom_histogram(binwidth =9, position = "identity", alpha = 0.5) + geom_vline(data = mu2, aes(xintercept=mean, color=Condition), linetype="dashed") + scale_color_manual(values=c("indianred3", "cadetblue3")) + theme_classic() + xlab("Root Biomass (g DW)") + ylab("Count") + theme(legend.position = c(0.9, 0.9)) + mytheme + ggtitle("Root Biomass Histogram")

# ANOVA
rootbiomass.aov <- aov(RootBiomass ~ Condition*Treatment, data = biomass)
summary(rootbiomass.aov) 
##                     Df Sum Sq Mean Sq F value   Pr(>F)    
## Condition            1   9152    9152  24.003 7.85e-06 ***
## Treatment            4   1171     293   0.768    0.551    
## Condition:Treatment  4    603     151   0.396    0.811    
## Residuals           59  22497     381                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# homogeneity of variance
plot(rootbiomass.aov, 1)

leveneTest(RootBiomass ~ Condition*Treatment, data = biomass) 
# normality test
plot(rootbiomass.aov, 2)

rootbiomass.residuals <- residuals(object = rootbiomass.aov)
shapiro.test(x = rootbiomass.residuals)
## 
##  Shapiro-Wilk normality test
## 
## data:  rootbiomass.residuals
## W = 0.87195, p-value = 4.087e-06
# identifying outliers
mod2 <- lm(RootBiomass ~ Condition, data = biomass)
cooksd2 <- cooks.distance(mod2)

plot(cooksd2, pch = "*", cex = 2, main = "Influential Observations in Root Biomass")
abline(h = 4*mean(cooksd2, na.rm = T), col = "red")
text(x=1: length(cooksd2) + 1, y= cooksd2, labels = ifelse(cooksd2>4*mean(cooksd2, na.rm = T), names(cooksd2), ""), col = "red")

# same samples are causing the irregularity
rootbiomass.out <- as.numeric(names(cooksd2)[(cooksd2 > 4*mean(cooksd2, na.rm = T))])
head(biomass[rootbiomass.out, ])
# removing outliers and testing impact
biomass <- biomass[-c(67,72), ]

ggqqplot(biomass$RootBiomass)

shapiro.test(biomass$RootBiomass)
## 
##  Shapiro-Wilk normality test
## 
## data:  biomass$RootBiomass
## W = 0.84494, p-value = 6.277e-07

Root:Shoot

# density histogram
ggplot(data = biomass, aes(x = RootShoot)) + geom_histogram(binwidth = 0.8, aes(y =..density..), colour = "black", fill = "white") + geom_density(alpha = 0.2, fill = "#FF6666") + mytheme + ggtitle("Root:Shoot Density Histogram")

# by water treatment
mu3 <- biomass %>% 
  group_by(Condition) %>% 
  summarise(mean = mean(RootShoot))

ggplot(data = biomass, aes(x = RootShoot, fill = Condition)) + geom_histogram(binwidth = 0.8, position = "identity", alpha = 0.5) + geom_vline(data = mu3, aes(xintercept=mean, color=Condition), linetype="dashed") + scale_color_manual(values=c("indianred3", "cadetblue3")) + theme_classic() + xlab("RootShoot") + ylab("Count") + theme(legend.position = c(0.9, 0.9)) + mytheme + ggtitle("Root:Shoot Histogram")

# ANOVA
rootshoot.aov <- aov(RootShoot ~ Condition*Treatment, data = biomass)
summary(rootshoot.aov) 
##                     Df Sum Sq Mean Sq F value Pr(>F)  
## Condition            1   3.83   3.831   0.761 0.3865  
## Treatment            4  50.40  12.601   2.504 0.0519 .
## Condition:Treatment  4  34.05   8.512   1.691 0.1643  
## Residuals           58 291.87   5.032                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# homogeneity of variance
plot(rootshoot.aov, 1) 

leveneTest(RootShoot ~ Condition*Treatment, data = biomass)
# normality test
plot(rootshoot.aov, 2)

rootshoot.residuals <- residuals(object = rootshoot.aov)
shapiro.test(x = rootshoot.residuals) 
## 
##  Shapiro-Wilk normality test
## 
## data:  rootshoot.residuals
## W = 0.92123, p-value = 0.0003675
# identifying outliers
mod3 <- lm(RootShoot ~ Condition, data = biomass)
cooksd3 <- cooks.distance(mod3)

plot(cooksd3, pch = "*", cex = 2, main = "Influential Observations in RootShoot")
abline(h = 4*mean(cooksd3, na.rm = T), col = "red")
text(x=1: length(cooksd3) + 1, y= cooksd3, labels = ifelse(cooksd3>4*mean(cooksd3, na.rm = T), names(cooksd3), ""), col = "red")

rootbiomass.out <- as.numeric(names(cooksd3)[(cooksd3 > 4*mean(cooksd3, na.rm = T))])
head(biomass[rootbiomass.out, ])
# removing outliers and testing impact
biomass.rootshoot <- biomass[-c(10,42, 51, 54), ]

ggqqplot(biomass.rootshoot$RootShoot)

shapiro.test(biomass.rootshoot$RootShoot)
## 
##  Shapiro-Wilk normality test
## 
## data:  biomass.rootshoot$RootShoot
## W = 0.84147, p-value = 9.126e-07

RMF

# density histogram
ggplot(data = biomass, aes(x = RMF)) + geom_histogram(binwidth = 0.03, aes(y =..density..), colour = "black", fill = "white") + geom_density(alpha = 0.2, fill = "#FF6666") + mytheme + ggtitle("Root Mass Fraction Density Histogram")

# by water treatment
mu4 <- biomass%>% 
  group_by(Condition) %>% 
  summarise(mean = mean(RMF))

ggplot(data = biomass, aes(x = RMF, fill = Condition)) + geom_histogram(binwidth = 0.03, position = "identity", alpha = 0.5) + geom_vline(data = mu4, aes(xintercept=mean, color=Condition), linetype="dashed") + scale_color_manual(values=c("indianred3", "cadetblue3")) + theme_classic() + xlab("Root Mass Fraction") + ylab("Count") + theme(legend.position = c(0.9, 0.9)) + mytheme + ggtitle("Root Mass Fraction Histogram")

# ANOVA
rmf.aov <- aov(RMF~ Condition*Treatment, data = biomass)
summary(rmf.aov) 
##                     Df Sum Sq  Mean Sq F value Pr(>F)  
## Condition            1 0.0005 0.000502   0.058 0.8108  
## Treatment            4 0.0871 0.021787   2.511 0.0514 .
## Condition:Treatment  4 0.0324 0.008109   0.935 0.4504  
## Residuals           58 0.5032 0.008676                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# homogeneity of variance
plot(rmf.aov, 1)

leveneTest(RMF ~ Condition*Treatment, data = biomass) 
# normality test
plot(rmf.aov, 2)

rmf.residuals <- residuals(object = rmf.aov)
shapiro.test(x = rmf.residuals) 
## 
##  Shapiro-Wilk normality test
## 
## data:  rmf.residuals
## W = 0.97668, p-value = 0.2316

Note: Root mass fraction = mass of fine root (g) / total biomass (g)

Physiology Measurements

Malic Acid Titrations

library(tidyverse)
clusia.malic <- read.csv("~/Documents/LabStats/Clusia/MalicAcid.csv", header = TRUE , sep = ",", stringsAsFactors = TRUE, na.strings = "na")

Malic Acid Controls

# Week 0
wk0.controls <- clusia.malic %>% 
  filter(Treatment == "Control" | Treatment == "Control Mock") %>% 
  filter(Week == "Wk_0") %>% 
  arrange(Condition, Treatment)

malic.control0.aov <- aov(MalicAverage ~ Condition * Treatment, data = wk0.controls)
summary(malic.control0.aov) # not sigificant between autoclaved and inoculated controls
##                     Df Sum Sq Mean Sq F value Pr(>F)
## Condition            1   1769    1769   0.409  0.546
## Treatment            1      2       2   0.000  0.983
## Condition:Treatment  1     43      43   0.010  0.923
## Residuals            6  25922    4320               
## 1 observation deleted due to missingness
# Week 2
wk2.controls <- clusia.malic %>% 
  filter(Treatment == "Control" | Treatment == "Control Mock") %>% 
  filter(Week == "Wk_2") %>% 
  arrange(Condition, Treatment)

malic.control2.aov <- aov(MalicAverage ~ Condition * Treatment, data = wk2.controls)
summary(malic.control2.aov) # not sigificant between autoclaved and inoculated controls
##                     Df Sum Sq Mean Sq F value  Pr(>F)   
## Condition            1 150438  150438  11.524 0.00944 **
## Treatment            1  27151   27151   2.080 0.18724   
## Condition:Treatment  1   1951    1951   0.149 0.70916   
## Residuals            8 104439   13055                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Week 4
wk4.controls <- clusia.malic %>% 
  filter(Treatment == "Control" | Treatment == "Control Mock") %>% 
  filter(Week == "Wk_4") %>% 
  arrange(Condition, Treatment)

malic.control4.aov <- aov(MalicAverage ~ Condition * Treatment, data = wk4.controls)
summary(malic.control4.aov) # not sigificant between autoclaved and inoculated controls
##             Df Sum Sq Mean Sq F value Pr(>F)
## Condition    1  81042   81042   2.159  0.202
## Treatment    1  19763   19763   0.526  0.501
## Residuals    5 187700   37540
# Week 6
wk6.controls <- clusia.malic %>% 
  filter(Treatment == "Control" | Treatment == "Control Mock") %>% 
  filter(Week == "Wk_6") %>% 
  arrange(Condition, Treatment)

malic.control6.aov <- aov(MalicAverage ~ Condition * Treatment, data = wk6.controls)
summary(malic.control6.aov) # not sigificant between autoclaved and inoculated controls
##                     Df Sum Sq Mean Sq F value Pr(>F)
## Condition            1   4834    4834   0.713  0.426
## Treatment            1   1836    1836   0.271  0.619
## Condition:Treatment  1   4706    4706   0.695  0.432
## Residuals            7  47427    6775
# Week 8
wk8.controls <- clusia.malic %>% 
  filter(Treatment == "Control" | Treatment == "Control Mock") %>% 
  filter(Week == "Wk_8") %>% 
  arrange(Condition, Treatment)

malic.control8.aov <- aov(MalicAverage ~ Condition * Treatment, data = wk8.controls)
summary(malic.control8.aov) # not sigificant between autoclaved and inoculated controls
##                     Df Sum Sq Mean Sq F value   Pr(>F)    
## Condition            1 516094  516094 141.946 2.26e-06 ***
## Treatment            1    112     112   0.031    0.865    
## Condition:Treatment  1     10      10   0.003    0.960    
## Residuals            8  29087    3636                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# removing Control Mock & fixing 'Null isolates'
clusia.malic <- clusia.malic %>% 
  filter(Treatment != "Control Mock")

clusia.malic$Treatment[clusia.malic$Treatment == "Null Isolates"] <- "Nonfunctional Isolates"
clusia.malic$Treatment[clusia.malic$Treatment == "Null_Isolates"] <- "Nonfunctional Isolates"
clusia.malic$Treatment[clusia.malic$Treatment == "All_Isolates"] <- "All Isolates"
clusia.malic$Treatment[clusia.malic$Treatment == "Drought_Isolates"] <- "Drought Isolates"
clusia.malic$Treatment[clusia.malic$Treatment == "Phosphorus_Isolates"] <- "Phosphorus Isolates"

# arranging by Week, Water, and Treatment
clusia.malic <- clusia.malic %>% 
  arrange(Week, Condition, Treatment)

Mean, SD, Std.Error

malic.sum <- clusia.malic %>% 
  group_by(Week, Condition, Treatment) %>% 
  summarise(n = n(),
            mean_malic = mean(MalicAverage, na.rm = TRUE),
            sd_malic = sd(MalicAverage, na.rm = TRUE),
            se = sd(MalicAverage, na.rm = TRUE)/sqrt(n()))
View(malic.sum)

Malic Acid ANOVAs

Week 0

# subsetting Week 0
malic.wk0 <- clusia.malic %>% 
  filter(Week == "Wk_0")

# density histogram
ggplot(data = malic.wk0, aes(x = MalicAverage)) + geom_histogram(binwidth = 25, aes(y =..density..), colour = "black", fill = "white") + geom_density(alpha = 0.2, fill = "#FF6666") 
## Warning: Removed 3 rows containing non-finite values (stat_bin).
## Warning: Removed 3 rows containing non-finite values (stat_density).

# by water treatment
malic.wk0.mu <- malic.wk0%>% 
  group_by(Condition) %>% 
  summarise(mean = mean(MalicAverage, na.rm = TRUE))

ggplot(data = malic.wk0, aes(x = MalicAverage, fill = Condition)) + geom_histogram(binwidth = 25, position = "identity", alpha = 0.5) + geom_vline(data = malic.wk0.mu, aes(xintercept=mean, color=Condition), linetype="dashed") + scale_color_manual(values=c("indianred3", "cadetblue3")) + theme_classic() + xlab("Malic Acid") + ylab("Count") + theme(legend.position = c(0.9, 0.9))
## Warning: Removed 3 rows containing non-finite values (stat_bin).

# ANOVA
malic.wk0.aov <- aov(MalicAverage ~ Condition * Treatment, data = malic.wk0)
summary(malic.wk0.aov) # not sigificant between treatment
##                     Df Sum Sq Mean Sq F value Pr(>F)
## Condition            1     71      71   0.016  0.901
## Treatment            5  12528    2506   0.564  0.726
## Condition:Treatment  4  10351    2588   0.582  0.680
## Residuals           16  71089    4443               
## 3 observations deleted due to missingness
# testing homogeneity of variances
plot(malic.wk0.aov, 1)

leveneTest(MalicAverage ~ Condition*Treatment, data = malic.wk0) # p > 0.05 means no violation of homogeneity of varaince
# normality test
plot(malic.wk0.aov, 2)
## Warning: not plotting observations with leverage one:
##   20

malic.wk0.residuals <- residuals(object = malic.wk0.aov)
shapiro.test(x = malic.wk0.residuals) # p > 0.05 means normal data 
## 
##  Shapiro-Wilk normality test
## 
## data:  malic.wk0.residuals
## W = 0.95026, p-value = 0.2175
ggqqplot(malic.wk0$MalicAverage)
## Warning: Removed 3 rows containing non-finite values (stat_qq).
## Warning: Removed 3 rows containing non-finite values (stat_qq_line).

## Warning: Removed 3 rows containing non-finite values (stat_qq_line).

shapiro.test(malic.wk0$MalicAverage)
## 
##  Shapiro-Wilk normality test
## 
## data:  malic.wk0$MalicAverage
## W = 0.97483, p-value = 0.732

Week 2

malic.wk2 <- clusia.malic %>% 
  filter(Week == "Wk_2")

malic.wk2.aov <- aov(MalicAverage ~ Condition * Treatment, data = malic.wk2)
summary(malic.wk2.aov)
##                     Df Sum Sq Mean Sq F value   Pr(>F)    
## Condition            1 287098  287098  36.643 8.02e-06 ***
## Treatment            4  34396    8599   1.098  0.38626    
## Condition:Treatment  4 211782   52946   6.757  0.00147 ** 
## Residuals           19 148867    7835                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 1 observation deleted due to missingness

Week 4

# subset for Week 4
malic.wk4 <- clusia.malic %>% 
  filter(Week == "Wk_4")

# density histogram
ggplot(data = malic.wk4, aes(x = MalicAverage)) + geom_histogram(binwidth = 50, aes(y =..density..), colour = "black", fill = "white") + geom_density(alpha = 0.2, fill = "#FF6666") 

# by water treatment
malic.wk4.mu <- malic.wk4%>% 
  group_by(Condition) %>% 
  summarise(mean = mean(MalicAverage, na.rm = TRUE))

ggplot(data = malic.wk4, aes(x = MalicAverage, fill = Condition)) + geom_histogram(binwidth = 50, position = "identity", alpha = 0.5) + geom_vline(data = malic.wk4.mu, aes(xintercept=mean, color=Condition), linetype="dashed") + scale_color_manual(values=c("indianred3", "cadetblue3")) + theme_classic() + xlab("Malic Acid") + ylab("Count") + theme(legend.position = c(0.9, 0.9))

# ANOVA
malic.wk4.aov <- aov(MalicAverage ~ Condition * Treatment, data = malic.wk4)
summary(malic.wk4.aov)
##                     Df Sum Sq Mean Sq F value  Pr(>F)   
## Condition            1 802650  802650  12.430 0.00306 **
## Treatment            4 133019   33255   0.515 0.72590   
## Condition:Treatment  4  65953   16488   0.255 0.90188   
## Residuals           15 968573   64572                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# testing homogeneity of variances
plot(malic.wk4.aov, 1)

leveneTest(MalicAverage ~ Condition*Treatment, data = malic.wk4) # p > 0.05 means no violation of homogeneity of varaince
# normality test
plot(malic.wk4.aov, 2)
## Warning: not plotting observations with leverage one:
##   6, 18

malic.wk4.residuals <- residuals(object = malic.wk4.aov)
shapiro.test(x = malic.wk4.residuals) # p > 0.05 means normal data
## 
##  Shapiro-Wilk normality test
## 
## data:  malic.wk4.residuals
## W = 0.97125, p-value = 0.6768
ggqqplot(malic.wk4$MalicAverage)

shapiro.test(malic.wk4$MalicAverage)
## 
##  Shapiro-Wilk normality test
## 
## data:  malic.wk4$MalicAverage
## W = 0.96563, p-value = 0.5375

Week 6

malic.wk6 <- clusia.malic %>% 
  filter(Week == "Wk_6")

malic.wk6.aov <- aov(MalicAverage ~ Condition * Treatment, data = malic.wk6)
summary(malic.wk6.aov) # sigificant drought effect
##                     Df Sum Sq Mean Sq F value   Pr(>F)    
## Condition            1 152326  152326  17.672 0.000437 ***
## Treatment            4  73866   18467   2.142 0.113048    
## Condition:Treatment  4 168945   42236   4.900 0.006424 ** 
## Residuals           20 172390    8619                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Week 8

# subsetting for Week 8 
malic.wk8 <- clusia.malic %>% 
  filter(Week == "Wk_8")

# density histogram
ggplot(data = malic.wk8, aes(x = MalicAverage)) + geom_histogram(binwidth = 80, aes(y =..density..), colour = "black", fill = "white") + geom_density(alpha = 0.2, fill = "#FF6666") 

# by water treatment
malic.wk8.mu <- malic.wk8%>% 
  group_by(Condition) %>% 
  summarise(mean = mean(MalicAverage, na.rm = TRUE))

ggplot(data = malic.wk8, aes(x = MalicAverage, fill = Condition)) + geom_histogram(binwidth = 80, position = "identity", alpha = 0.5) + geom_vline(data = malic.wk4.mu, aes(xintercept=mean, color=Condition), linetype="dashed") + scale_color_manual(values=c("indianred3", "cadetblue3")) + theme_classic() + xlab("Malic Acid") + ylab("Count") + theme(legend.position = c(0.9, 0.9))

# ANOVA
malic.wk8.aov <- aov(MalicAverage ~ Condition * Treatment, data = malic.wk8)
summary(malic.wk8.aov) # significant drought effect and microbial effect
##                     Df Sum Sq Mean Sq F value   Pr(>F)    
## Condition            1 432864  432864  26.157 5.29e-05 ***
## Treatment            4 227707   56927   3.440    0.027 *  
## Condition:Treatment  4  77288   19322   1.168    0.355    
## Residuals           20 330968   16548                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
TukeyHSD(malic.wk8.aov)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = MalicAverage ~ Condition * Treatment, data = malic.wk8)
## 
## $Condition
##                        diff      lwr      upr    p adj
## Well-watered-Drought 240.24 142.2563 338.2237 5.29e-05
## 
## $Treatment
##                                                  diff         lwr
## Control-All Isolates                        134.41667  -87.828986
## Drought Isolates-All Isolates               -10.90000 -233.145653
## Nonfunctional Isolates-All Isolates         218.45000   -3.795653
## Phosphorus Isolates-All Isolates             45.50000 -176.745653
## Drought Isolates-Control                   -145.31667 -367.562319
## Nonfunctional Isolates-Control               84.03333 -138.212319
## Phosphorus Isolates-Control                 -88.91667 -311.162319
## Nonfunctional Isolates-Drought Isolates     229.35000    7.104347
## Phosphorus Isolates-Drought Isolates         56.40000 -165.845653
## Phosphorus Isolates-Nonfunctional Isolates -172.95000 -395.195653
##                                                  upr     p adj
## Control-All Isolates                       356.66232 0.3955729
## Drought Isolates-All Isolates              211.34565 0.9998858
## Nonfunctional Isolates-All Isolates        440.69565 0.0554856
## Phosphorus Isolates-All Isolates           267.74565 0.9713947
## Drought Isolates-Control                    76.92899 0.3217188
## Nonfunctional Isolates-Control             306.27899 0.7883022
## Phosphorus Isolates-Control                133.32899 0.7529027
## Nonfunctional Isolates-Drought Isolates    451.59565 0.0410511
## Phosphorus Isolates-Drought Isolates       278.64565 0.9392296
## Phosphorus Isolates-Nonfunctional Isolates  49.29565 0.1769778
## 
## $`Condition:Treatment`
##                                                                             diff
## Well-watered:All Isolates-Drought:All Isolates                        176.266667
## Drought:Control-Drought:All Isolates                                   14.266667
## Well-watered:Control-Drought:All Isolates                             430.833333
## Drought:Drought Isolates-Drought:All Isolates                           4.433333
## Well-watered:Drought Isolates-Drought:All Isolates                    150.033333
## Drought:Nonfunctional Isolates-Drought:All Isolates                   160.833333
## Well-watered:Nonfunctional Isolates-Drought:All Isolates              452.333333
## Drought:Phosphorus Isolates-Drought:All Isolates                       48.000000
## Well-watered:Phosphorus Isolates-Drought:All Isolates                 219.266667
## Drought:Control-Well-watered:All Isolates                            -162.000000
## Well-watered:Control-Well-watered:All Isolates                        254.566667
## Drought:Drought Isolates-Well-watered:All Isolates                   -171.833333
## Well-watered:Drought Isolates-Well-watered:All Isolates               -26.233333
## Drought:Nonfunctional Isolates-Well-watered:All Isolates              -15.433333
## Well-watered:Nonfunctional Isolates-Well-watered:All Isolates         276.066667
## Drought:Phosphorus Isolates-Well-watered:All Isolates                -128.266667
## Well-watered:Phosphorus Isolates-Well-watered:All Isolates             43.000000
## Well-watered:Control-Drought:Control                                  416.566667
## Drought:Drought Isolates-Drought:Control                               -9.833333
## Well-watered:Drought Isolates-Drought:Control                         135.766667
## Drought:Nonfunctional Isolates-Drought:Control                        146.566667
## Well-watered:Nonfunctional Isolates-Drought:Control                   438.066667
## Drought:Phosphorus Isolates-Drought:Control                            33.733333
## Well-watered:Phosphorus Isolates-Drought:Control                      205.000000
## Drought:Drought Isolates-Well-watered:Control                        -426.400000
## Well-watered:Drought Isolates-Well-watered:Control                   -280.800000
## Drought:Nonfunctional Isolates-Well-watered:Control                  -270.000000
## Well-watered:Nonfunctional Isolates-Well-watered:Control               21.500000
## Drought:Phosphorus Isolates-Well-watered:Control                     -382.833333
## Well-watered:Phosphorus Isolates-Well-watered:Control                -211.566667
## Well-watered:Drought Isolates-Drought:Drought Isolates                145.600000
## Drought:Nonfunctional Isolates-Drought:Drought Isolates               156.400000
## Well-watered:Nonfunctional Isolates-Drought:Drought Isolates          447.900000
## Drought:Phosphorus Isolates-Drought:Drought Isolates                   43.566667
## Well-watered:Phosphorus Isolates-Drought:Drought Isolates             214.833333
## Drought:Nonfunctional Isolates-Well-watered:Drought Isolates           10.800000
## Well-watered:Nonfunctional Isolates-Well-watered:Drought Isolates     302.300000
## Drought:Phosphorus Isolates-Well-watered:Drought Isolates            -102.033333
## Well-watered:Phosphorus Isolates-Well-watered:Drought Isolates         69.233333
## Well-watered:Nonfunctional Isolates-Drought:Nonfunctional Isolates    291.500000
## Drought:Phosphorus Isolates-Drought:Nonfunctional Isolates           -112.833333
## Well-watered:Phosphorus Isolates-Drought:Nonfunctional Isolates        58.433333
## Drought:Phosphorus Isolates-Well-watered:Nonfunctional Isolates      -404.333333
## Well-watered:Phosphorus Isolates-Well-watered:Nonfunctional Isolates -233.066667
## Well-watered:Phosphorus Isolates-Drought:Phosphorus Isolates          171.266667
##                                                                             lwr
## Well-watered:All Isolates-Drought:All Isolates                       -195.67212
## Drought:Control-Drought:All Isolates                                 -357.67212
## Well-watered:Control-Drought:All Isolates                              58.89455
## Drought:Drought Isolates-Drought:All Isolates                        -367.50545
## Well-watered:Drought Isolates-Drought:All Isolates                   -221.90545
## Drought:Nonfunctional Isolates-Drought:All Isolates                  -211.10545
## Well-watered:Nonfunctional Isolates-Drought:All Isolates               80.39455
## Drought:Phosphorus Isolates-Drought:All Isolates                     -323.93878
## Well-watered:Phosphorus Isolates-Drought:All Isolates                -152.67212
## Drought:Control-Well-watered:All Isolates                            -533.93878
## Well-watered:Control-Well-watered:All Isolates                       -117.37212
## Drought:Drought Isolates-Well-watered:All Isolates                   -543.77212
## Well-watered:Drought Isolates-Well-watered:All Isolates              -398.17212
## Drought:Nonfunctional Isolates-Well-watered:All Isolates             -387.37212
## Well-watered:Nonfunctional Isolates-Well-watered:All Isolates         -95.87212
## Drought:Phosphorus Isolates-Well-watered:All Isolates                -500.20545
## Well-watered:Phosphorus Isolates-Well-watered:All Isolates           -328.93878
## Well-watered:Control-Drought:Control                                   44.62788
## Drought:Drought Isolates-Drought:Control                             -381.77212
## Well-watered:Drought Isolates-Drought:Control                        -236.17212
## Drought:Nonfunctional Isolates-Drought:Control                       -225.37212
## Well-watered:Nonfunctional Isolates-Drought:Control                    66.12788
## Drought:Phosphorus Isolates-Drought:Control                          -338.20545
## Well-watered:Phosphorus Isolates-Drought:Control                     -166.93878
## Drought:Drought Isolates-Well-watered:Control                        -798.33878
## Well-watered:Drought Isolates-Well-watered:Control                   -652.73878
## Drought:Nonfunctional Isolates-Well-watered:Control                  -641.93878
## Well-watered:Nonfunctional Isolates-Well-watered:Control             -350.43878
## Drought:Phosphorus Isolates-Well-watered:Control                     -754.77212
## Well-watered:Phosphorus Isolates-Well-watered:Control                -583.50545
## Well-watered:Drought Isolates-Drought:Drought Isolates               -226.33878
## Drought:Nonfunctional Isolates-Drought:Drought Isolates              -215.53878
## Well-watered:Nonfunctional Isolates-Drought:Drought Isolates           75.96122
## Drought:Phosphorus Isolates-Drought:Drought Isolates                 -328.37212
## Well-watered:Phosphorus Isolates-Drought:Drought Isolates            -157.10545
## Drought:Nonfunctional Isolates-Well-watered:Drought Isolates         -361.13878
## Well-watered:Nonfunctional Isolates-Well-watered:Drought Isolates     -69.63878
## Drought:Phosphorus Isolates-Well-watered:Drought Isolates            -473.97212
## Well-watered:Phosphorus Isolates-Well-watered:Drought Isolates       -302.70545
## Well-watered:Nonfunctional Isolates-Drought:Nonfunctional Isolates    -80.43878
## Drought:Phosphorus Isolates-Drought:Nonfunctional Isolates           -484.77212
## Well-watered:Phosphorus Isolates-Drought:Nonfunctional Isolates      -313.50545
## Drought:Phosphorus Isolates-Well-watered:Nonfunctional Isolates      -776.27212
## Well-watered:Phosphorus Isolates-Well-watered:Nonfunctional Isolates -605.00545
## Well-watered:Phosphorus Isolates-Drought:Phosphorus Isolates         -200.67212
##                                                                            upr
## Well-watered:All Isolates-Drought:All Isolates                       548.20545
## Drought:Control-Drought:All Isolates                                 386.20545
## Well-watered:Control-Drought:All Isolates                            802.77212
## Drought:Drought Isolates-Drought:All Isolates                        376.37212
## Well-watered:Drought Isolates-Drought:All Isolates                   521.97212
## Drought:Nonfunctional Isolates-Drought:All Isolates                  532.77212
## Well-watered:Nonfunctional Isolates-Drought:All Isolates             824.27212
## Drought:Phosphorus Isolates-Drought:All Isolates                     419.93878
## Well-watered:Phosphorus Isolates-Drought:All Isolates                591.20545
## Drought:Control-Well-watered:All Isolates                            209.93878
## Well-watered:Control-Well-watered:All Isolates                       626.50545
## Drought:Drought Isolates-Well-watered:All Isolates                   200.10545
## Well-watered:Drought Isolates-Well-watered:All Isolates              345.70545
## Drought:Nonfunctional Isolates-Well-watered:All Isolates             356.50545
## Well-watered:Nonfunctional Isolates-Well-watered:All Isolates        648.00545
## Drought:Phosphorus Isolates-Well-watered:All Isolates                243.67212
## Well-watered:Phosphorus Isolates-Well-watered:All Isolates           414.93878
## Well-watered:Control-Drought:Control                                 788.50545
## Drought:Drought Isolates-Drought:Control                             362.10545
## Well-watered:Drought Isolates-Drought:Control                        507.70545
## Drought:Nonfunctional Isolates-Drought:Control                       518.50545
## Well-watered:Nonfunctional Isolates-Drought:Control                  810.00545
## Drought:Phosphorus Isolates-Drought:Control                          405.67212
## Well-watered:Phosphorus Isolates-Drought:Control                     576.93878
## Drought:Drought Isolates-Well-watered:Control                        -54.46122
## Well-watered:Drought Isolates-Well-watered:Control                    91.13878
## Drought:Nonfunctional Isolates-Well-watered:Control                  101.93878
## Well-watered:Nonfunctional Isolates-Well-watered:Control             393.43878
## Drought:Phosphorus Isolates-Well-watered:Control                     -10.89455
## Well-watered:Phosphorus Isolates-Well-watered:Control                160.37212
## Well-watered:Drought Isolates-Drought:Drought Isolates               517.53878
## Drought:Nonfunctional Isolates-Drought:Drought Isolates              528.33878
## Well-watered:Nonfunctional Isolates-Drought:Drought Isolates         819.83878
## Drought:Phosphorus Isolates-Drought:Drought Isolates                 415.50545
## Well-watered:Phosphorus Isolates-Drought:Drought Isolates            586.77212
## Drought:Nonfunctional Isolates-Well-watered:Drought Isolates         382.73878
## Well-watered:Nonfunctional Isolates-Well-watered:Drought Isolates    674.23878
## Drought:Phosphorus Isolates-Well-watered:Drought Isolates            269.90545
## Well-watered:Phosphorus Isolates-Well-watered:Drought Isolates       441.17212
## Well-watered:Nonfunctional Isolates-Drought:Nonfunctional Isolates   663.43878
## Drought:Phosphorus Isolates-Drought:Nonfunctional Isolates           259.10545
## Well-watered:Phosphorus Isolates-Drought:Nonfunctional Isolates      430.37212
## Drought:Phosphorus Isolates-Well-watered:Nonfunctional Isolates      -32.39455
## Well-watered:Phosphorus Isolates-Well-watered:Nonfunctional Isolates 138.87212
## Well-watered:Phosphorus Isolates-Drought:Phosphorus Isolates         543.20545
##                                                                          p adj
## Well-watered:All Isolates-Drought:All Isolates                       0.7947843
## Drought:Control-Drought:All Isolates                                 1.0000000
## Well-watered:Control-Drought:All Isolates                            0.0154590
## Drought:Drought Isolates-Drought:All Isolates                        1.0000000
## Well-watered:Drought Isolates-Drought:All Isolates                   0.9038592
## Drought:Nonfunctional Isolates-Drought:All Isolates                  0.8641714
## Well-watered:Nonfunctional Isolates-Drought:All Isolates             0.0099410
## Drought:Phosphorus Isolates-Drought:All Isolates                     0.9999755
## Well-watered:Phosphorus Isolates-Drought:All Isolates                0.5547819
## Drought:Control-Well-watered:All Isolates                            0.8594242
## Well-watered:Control-Well-watered:All Isolates                       0.3628413
## Drought:Drought Isolates-Well-watered:All Isolates                   0.8161033
## Well-watered:Drought Isolates-Well-watered:All Isolates              0.9999999
## Drought:Nonfunctional Isolates-Well-watered:All Isolates             1.0000000
## Well-watered:Nonfunctional Isolates-Well-watered:All Isolates        0.2669553
## Drought:Phosphorus Isolates-Well-watered:All Isolates                0.9598867
## Well-watered:Phosphorus Isolates-Well-watered:All Isolates           0.9999904
## Well-watered:Control-Drought:Control                                 0.0206593
## Drought:Drought Isolates-Drought:Control                             1.0000000
## Well-watered:Drought Isolates-Drought:Control                        0.9441305
## Drought:Nonfunctional Isolates-Drought:Control                       0.9149227
## Well-watered:Nonfunctional Isolates-Drought:Control                  0.0133322
## Drought:Phosphorus Isolates-Drought:Control                          0.9999988
## Well-watered:Phosphorus Isolates-Drought:Control                     0.6379264
## Drought:Drought Isolates-Well-watered:Control                        0.0169217
## Well-watered:Drought Isolates-Well-watered:Control                   0.2484541
## Drought:Nonfunctional Isolates-Well-watered:Control                  0.2920641
## Well-watered:Nonfunctional Isolates-Well-watered:Control             1.0000000
## Drought:Phosphorus Isolates-Well-watered:Control                     0.0404567
## Well-watered:Phosphorus Isolates-Well-watered:Control                0.5996719
## Well-watered:Drought Isolates-Drought:Drought Isolates               0.9178606
## Drought:Nonfunctional Isolates-Drought:Drought Isolates              0.8814053
## Well-watered:Nonfunctional Isolates-Drought:Drought Isolates         0.0108926
## Drought:Phosphorus Isolates-Drought:Drought Isolates                 0.9999893
## Well-watered:Phosphorus Isolates-Drought:Drought Isolates            0.5806005
## Drought:Nonfunctional Isolates-Well-watered:Drought Isolates         1.0000000
## Well-watered:Nonfunctional Isolates-Well-watered:Drought Isolates    0.1762492
## Drought:Phosphorus Isolates-Well-watered:Drought Isolates            0.9908546
## Well-watered:Phosphorus Isolates-Well-watered:Drought Isolates       0.9994979
## Well-watered:Nonfunctional Isolates-Drought:Nonfunctional Isolates   0.2101330
## Drought:Phosphorus Isolates-Drought:Nonfunctional Isolates           0.9820104
## Well-watered:Phosphorus Isolates-Drought:Nonfunctional Isolates      0.9998729
## Drought:Phosphorus Isolates-Well-watered:Nonfunctional Isolates      0.0264265
## Well-watered:Phosphorus Isolates-Well-watered:Nonfunctional Isolates 0.4759768
## Well-watered:Phosphorus Isolates-Drought:Phosphorus Isolates         0.8187525
# testing homogeneity of variances
plot(malic.wk8.aov, 1)

leveneTest(MalicAverage ~ Condition*Treatment, data = malic.wk8) # p > 0.05 means no violation of homogeneity of varaince
# normality test
plot(malic.wk8.aov, 2)

malic.wk8.residuals <- residuals(object = malic.wk8.aov)
shapiro.test(x = malic.wk8.residuals) # p > 0.05 means normal data
## 
##  Shapiro-Wilk normality test
## 
## data:  malic.wk8.residuals
## W = 0.95804, p-value = 0.2757
ggqqplot(malic.wk8$MalicAverage)

shapiro.test(malic.wk8$MalicAverage)
## 
##  Shapiro-Wilk normality test
## 
## data:  malic.wk8$MalicAverage
## W = 0.92367, p-value = 0.03344
# identifying outliers
wk8.mod <- lm(MalicAverage ~ Condition, data = malic.wk8)
cooksd.wk8 <- cooks.distance(wk8.mod)

plot(cooksd.wk8, pch = "*", cex = 2, main = "Influential Observations in Wk 8 Malic Acid")
abline(h = 4*mean(cooksd.wk8, na.rm = T), col = "red")
text(x=1: length(cooksd.wk8) + 1, y= cooksd.wk8, labels = ifelse(cooksd.wk8>4*mean(cooksd.wk8, na.rm = T), names(cooksd.wk8), ""), col = "red")

wk8.malic.out <- as.numeric(names(cooksd.wk8)[(cooksd.wk8 > 4*mean(cooksd.wk8, na.rm = T))])
head(biomass[wk8.malic.out, ])
# removing outliers and testing impact
malic.wk8 <- malic.wk8[-c(24), ]

ggqqplot(malic.wk8$MalicAverage)

shapiro.test(malic.wk8$MalicAverage)
## 
##  Shapiro-Wilk normality test
## 
## data:  malic.wk8$MalicAverage
## W = 0.92338, p-value = 0.03717
clusia.boxplot <- ggplot(data = clusia.malic, aes(x = Treatment, y = MalicAverage, fill = Condition)) + geom_boxplot() + geom_point(aes(fill = Condition), size = 2, shape = 21, position = position_jitterdodge()) + facet_grid(. ~ Week) 

clusia.boxplot <- clusia.boxplot + theme_bw() +scale_fill_manual(values=c("indianred3", "cadetblue3"), breaks=c("Well-watered", "Drought"),labels=c("Well-watered", "Drought")) + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank()) + theme(axis.title.x = element_blank()) + theme(axis.text.x = element_text(angle = 45, hjust = 1, vjust = 1)) + theme(legend.position = c(0.095, 0.9))

clusia.boxplot <- clusia.boxplot + ylab(expression(Malic~Acid~Concentration~(mu~mol~H~g^{-1})))

pdf("MalicAcid_Boxplot.pdf")
plot(clusia.boxplot)
## Warning: Removed 4 rows containing non-finite values (stat_boxplot).
## Warning: Removed 4 rows containing missing values (geom_point).
dev.off()
## quartz_off_screen 
##                 2

At Week 0, both well-watered and drought plants show no difference in malic acid concentrations as expected. However, as the drought trial progresses, well-watered plants and drought plants begin to diverge significantly at Week 2 (p-value < 0.001). Higher amounts of malic acid in well-watered plants indicate higher CAM activity, which is in contrast with hypotheses that CAM activity would be highest in drought plants due to experiencing drought stress. Furthermore, there was no significant effect of microbial community until the last week (p- value < 0.05) with no interaction term, suggesting that availability of water is still the dominant driver of malic acid concentration. Tukeys HSD results indicate that although the differences in microbial communities are different, that these differences are occuring between well-watered microbial communities versus droughted microbial communities, verifying that the water availability is driving differences between plants and not the composition of the the microbial communities themselves.

Lipid Peroxidation Assay

clusia.lipid <- read.csv("~/Documents/Git/clusia_droughtexperiment/LipidPeroxidation.csv", header = TRUE , sep = ",", stringsAsFactors = TRUE, na.strings = "na")

Lipid Peroxidation Controls

# Week 0
wk0.controls <- clusia.lipid %>% 
  filter(Treatment == "Control" | Treatment == "Control Mock") %>% 
  filter(Week == "Wk_0") %>% 
  arrange(Condition, Treatment)

lipid.control0.aov <- aov(LipidPerox ~ Condition * Treatment, data = wk0.controls)
summary(lipid.control0.aov) # not sigificant between autoclaved and inoculated controls
##                     Df Sum Sq Mean Sq F value Pr(>F)
## Condition            1    1.0    1.05   0.019  0.895
## Treatment            1   20.1   20.07   0.357  0.569
## Condition:Treatment  1   44.0   44.03   0.782  0.406
## Residuals            7  393.9   56.27
# Week 2
wk2.controls <- clusia.lipid %>% 
  filter(Treatment == "Control" | Treatment == "Control Mock") %>% 
  filter(Week == "Wk_2") %>% 
  arrange(Condition, Treatment)

lipid.control2.aov <- aov(LipidPerox ~ Condition * Treatment, data = wk2.controls)
summary(lipid.control2.aov) # not sigificant between autoclaved and inoculated controls
##                     Df Sum Sq Mean Sq F value Pr(>F)
## Condition            1   14.1   14.07   0.274  0.615
## Treatment            1   42.4   42.42   0.826  0.390
## Condition:Treatment  1   41.9   41.95   0.817  0.393
## Residuals            8  410.9   51.36
# Week 4
wk4.controls <- clusia.lipid %>% 
  filter(Treatment == "Control" | Treatment == "Control Mock") %>% 
  filter(Week == "Wk_4") %>% 
  arrange(Condition, Treatment)

lipid.control4.aov <- aov(LipidPerox ~ Condition * Treatment, data = wk4.controls)
summary(lipid.control4.aov) # not sigificant between autoclaved and inoculated controls
##                     Df Sum Sq Mean Sq F value Pr(>F)
## Condition            1   30.3   30.30   0.167  0.695
## Treatment            1   19.8   19.76   0.109  0.751
## Condition:Treatment  1   68.7   68.65   0.378  0.558
## Residuals            7 1272.0  181.71
# Week 6
wk6.controls <- clusia.lipid %>% 
  filter(Treatment == "Control" | Treatment == "Control Mock") %>% 
  filter(Week == "Wk_6") %>% 
  arrange(Condition, Treatment)

lipid.control6.aov <- aov(LipidPerox ~ Condition * Treatment, data = wk6.controls)
summary(lipid.control6.aov) # not sigificant between autoclaved and inoculated controls
##                     Df Sum Sq Mean Sq F value Pr(>F)
## Condition            1   1362  1362.1   1.763  0.226
## Treatment            1    475   474.5   0.614  0.459
## Condition:Treatment  1     86    86.4   0.112  0.748
## Residuals            7   5409   772.6
# Week 8
wk8.controls <- clusia.lipid %>% 
  filter(Treatment == "Control" | Treatment == "Control Mock") %>% 
  filter(Week == "Wk_8") %>% 
  arrange(Condition, Treatment)

lipid.control8.aov <- aov(LipidPerox ~ Condition * Treatment, data = wk8.controls)
summary(lipid.control8.aov) # not sigificant between autoclaved and inoculated controls
##                     Df Sum Sq Mean Sq F value Pr(>F)  
## Condition            1 1943.2  1943.2   9.942 0.0135 *
## Treatment            1   79.8    79.8   0.408 0.5408  
## Condition:Treatment  1    5.9     5.9   0.030 0.8658  
## Residuals            8 1563.6   195.5                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# removing Control Mock
clusia.lipid <- clusia.lipid %>% 
  filter(Treatment != "Control Mock")


# arranging by Week, Water, and Treatment
clusia.lipid <- clusia.lipid %>% 
  arrange(Week, Condition, Treatment)

Mean, SD, Std. Error

lipid.sum <- clusia.lipid %>% 
  group_by(Week, Condition, Treatment) %>% 
  summarise(n = n(),
            mean_lipid = mean(LipidPerox, na.rm = TRUE),
            sd_lipid = sd(LipidPerox, na.rm = TRUE),
            se = sd(LipidPerox, na.rm = TRUE)/sqrt(n()))
View(lipid.sum)

lipid.errobars <- ggplot(data = lipid.sum, aes(x = Treatment, y = mean_lipid, fill = Condition)) + geom_bar(stat = "identity", color = "black", position = position_dodge(0.9)) + geom_errorbar(aes(ymin = mean_lipid-sd_lipid, ymax = mean_lipid+sd_lipid), width = 0.2, position = position_dodge(0.9)) + facet_grid(. ~ Week)

lipid.errobars <- lipid.errobars + theme_bw() + scale_fill_manual(values=c("indianred3", "cadetblue3"), breaks=c("Well-watered", "Drought"),labels=c("Well-watered", "Drought")) + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank()) + theme(axis.title.x = element_blank()) + theme(axis.text.x = element_text(angle = 45, hjust = 1, vjust = 1)) + theme(legend.position = c(0.1, 0.8)) + ylab(expression(Mean~Lipid~Peroxidation~(nmol~MDA~g^{-1})))

lipid.errobars
## Warning: Removed 1 rows containing missing values (geom_errorbar).

Lipid Peroxidation ANOVAs

Week 0

# Week 0
lipid.wk0 <- clusia.lipid %>% 
  filter(Week == "Wk_0")

# density histogram
ggplot(data = lipid.wk0, aes(x = LipidPerox)) + geom_histogram(binwidth = 5, aes(y =..density..), colour = "black", fill = "white") + geom_density(alpha = 0.2, fill = "#FF6666") 

# by water treatment
lipid.wk0.mu <- lipid.wk0 %>% 
  group_by(Condition) %>% 
  summarise(mean = mean(LipidPerox, na.rm = TRUE))

ggplot(data = lipid.wk0, aes(x = LipidPerox, fill = Condition)) + geom_histogram(binwidth = 5, position = "identity", alpha = 0.5) + geom_vline(data = lipid.wk0.mu, aes(xintercept=mean, color=Condition), linetype="dashed") + scale_color_manual(values=c("indianred3", "cadetblue3")) + theme_classic() + xlab("Lipid Peroxidation") + ylab("Count") + theme(legend.position = c(0.9, 0.9))

# ANOVA
lipid.wk0.aov <- aov(LipidPerox ~ Condition * Treatment, data = lipid.wk0)
summary(lipid.wk0.aov) 
##                     Df Sum Sq Mean Sq F value Pr(>F)
## Condition            1   15.8   15.81   0.173  0.682
## Treatment            4  285.4   71.35   0.781  0.551
## Condition:Treatment  4  222.9   55.72   0.610  0.660
## Residuals           20 1827.3   91.36
# testing homogeneity of variances
plot(lipid.wk0.aov, 1)

leveneTest(LipidPerox ~ Condition*Treatment, data = lipid.wk0) # p > 0.05 means no violation of homogeneity of varaince
# normality test
plot(lipid.wk0.aov, 2)

lipid.wk0.residuals <- residuals(object = lipid.wk0.aov)
shapiro.test(x = lipid.wk0.residuals) # p < 0.05 means normal data
## 
##  Shapiro-Wilk normality test
## 
## data:  lipid.wk0.residuals
## W = 0.88192, p-value = 0.003121
ggqqplot(lipid.wk0$LipidPerox)

shapiro.test(lipid.wk0$LipidPerox)
## 
##  Shapiro-Wilk normality test
## 
## data:  lipid.wk0$LipidPerox
## W = 0.83772, p-value = 0.0003467
# identifying outliers
lipid.wk0.mod <- lm(LipidPerox ~ Condition, data = lipid.wk0)
cooksd.wk0 <- cooks.distance(lipid.wk0.mod)

plot(cooksd.wk0, pch = "*", cex = 2, main = "Influential Observations in Wk 0 Lipid Peroxidation")
abline(h = 4*mean(cooksd.wk0, na.rm = T), col = "red")
text(x=1: length(cooksd.wk0) + 1, y= cooksd.wk0, labels = ifelse(cooksd.wk0>4*mean(cooksd.wk0, na.rm = T), names(cooksd.wk0), ""), col = "red")

wk0.lipid.out <- as.numeric(names(cooksd.wk0)[(cooksd.wk0 > 4*mean(cooksd.wk0, na.rm = T))])
head(clusia.lipid[wk0.lipid.out, ])
# removing outliers and testing impact
lipid.wk0 <- lipid.wk0[-c(5), ]

ggqqplot(lipid.wk0$LipidPerox)

shapiro.test(lipid.wk0$LipidPerox)
## 
##  Shapiro-Wilk normality test
## 
## data:  lipid.wk0$LipidPerox
## W = 0.82971, p-value = 0.000299

Week 2

# Week 2
lipid.wk2 <- clusia.lipid %>% 
  filter(Week == "Wk_2")

lipid.wk2.aov <- aov(LipidPerox ~ Condition * Treatment, data = lipid.wk2)
summary(lipid.wk2.aov)
##                     Df Sum Sq Mean Sq F value Pr(>F)
## Condition            1   38.6   38.64   1.297  0.269
## Treatment            4  205.3   51.33   1.723  0.186
## Condition:Treatment  4  126.6   31.65   1.062  0.402
## Residuals           19  566.0   29.79

Week 4

# Week 4
lipid.wk4 <- clusia.lipid %>% 
  filter(Week == "Wk_4")

# density histogram
ggplot(data = lipid.wk4, aes(x = LipidPerox)) + geom_histogram(binwidth = 8, aes(y =..density..), colour = "black", fill = "white") + geom_density(alpha = 0.2, fill = "#FF6666") 

# by water treatment
lipid.wk4.mu <- lipid.wk4 %>% 
  group_by(Condition) %>% 
  summarise(mean = mean(LipidPerox, na.rm = TRUE))

ggplot(data = lipid.wk4, aes(x = LipidPerox, fill = Condition)) + geom_histogram(binwidth = 8, position = "identity", alpha = 0.5) + geom_vline(data = lipid.wk4.mu, aes(xintercept=mean, color=Condition), linetype="dashed") + scale_color_manual(values=c("indianred3", "cadetblue3")) + theme_classic() + xlab("Lipid Peroxidation") + ylab("Count") + theme(legend.position = c(0.9, 0.9))

# ANOVA
lipid.wk4.aov <- aov(LipidPerox ~ Condition * Treatment, data = lipid.wk4)
summary(lipid.wk4.aov) 
##                     Df Sum Sq Mean Sq F value Pr(>F)
## Condition            1     11    11.4   0.054  0.820
## Treatment            4   1702   425.6   2.001  0.143
## Condition:Treatment  4    774   193.5   0.909  0.482
## Residuals           16   3404   212.7
# testing homogeneity of variances
plot(lipid.wk4.aov, 1)

leveneTest(LipidPerox ~ Condition*Treatment, data = lipid.wk4) 
# normality test
plot(lipid.wk4.aov, 2)
## Warning: not plotting observations with leverage one:
##   7

lipid.wk4.residuals <- residuals(object = lipid.wk4.aov)
shapiro.test(x = lipid.wk4.residuals) 
## 
##  Shapiro-Wilk normality test
## 
## data:  lipid.wk4.residuals
## W = 0.96859, p-value = 0.5871
ggqqplot(lipid.wk4$LipidPerox)

shapiro.test(lipid.wk4$LipidPerox)
## 
##  Shapiro-Wilk normality test
## 
## data:  lipid.wk4$LipidPerox
## W = 0.96283, p-value = 0.4503

Week 6

# Week 6
lipid.wk6 <- clusia.lipid %>% 
  filter(Week == "Wk_6")

lipid.wk6.aov <- aov(LipidPerox ~ Condition * Treatment, data = lipid.wk6)
summary(lipid.wk6.aov)
##                     Df Sum Sq Mean Sq F value Pr(>F)  
## Condition            1      3     2.9   0.009 0.9234  
## Treatment            4   2790   697.5   2.261 0.0969 .
## Condition:Treatment  4   1515   378.9   1.228 0.3291  
## Residuals           21   6479   308.5                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Week 8

lipid.wk8 <- clusia.lipid %>% 
  filter(Week == "Wk_8")

# density histogram
ggplot(data = lipid.wk8, aes(x = LipidPerox)) + geom_histogram(binwidth = 10, aes(y =..density..), colour = "black", fill = "white") + geom_density(alpha = 0.2, fill = "#FF6666") 

# by water treatment
lipid.wk8.mu <- lipid.wk8 %>% 
  group_by(Condition) %>% 
  summarise(mean = mean(LipidPerox, na.rm = TRUE))

ggplot(data = lipid.wk8, aes(x = LipidPerox, fill = Condition)) + geom_histogram(binwidth = 10, position = "identity", alpha = 0.5) + geom_vline(data = lipid.wk8.mu, aes(xintercept=mean, color=Condition), linetype="dashed") + scale_color_manual(values=c("indianred3", "cadetblue3")) + theme_classic() + xlab("Lipid Peroxidation") + ylab("Count") + theme(legend.position = c(0.9, 0.9))

# ANOVA
lipid.wk8.aov <- aov(LipidPerox ~ Condition * Treatment, data = lipid.wk8)
summary(lipid.wk8.aov)
##                     Df Sum Sq Mean Sq F value  Pr(>F)   
## Condition            1   1762  1762.2   7.625 0.01204 * 
## Treatment            4   5627  1406.8   6.087 0.00226 **
## Condition:Treatment  4    475   118.7   0.513 0.72659   
## Residuals           20   4622   231.1                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
TukeyHSD(lipid.wk8.aov)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = LipidPerox ~ Condition * Treatment, data = lipid.wk8)
## 
## $Condition
##                           diff       lwr       upr     p adj
## Well-watered-Drought -15.32833 -26.90781 -3.748853 0.0120432
## 
## $Treatment
##                                                   diff       lwr       upr
## Control-All Isolates                       -35.8098333 -62.07429 -9.545381
## Drought Isolates-All Isolates              -24.8580000 -51.12245  1.406452
## Nonfunctional Isolates-All Isolates        -34.7236667 -60.98812 -8.459214
## Phosphorus Isolates-All Isolates           -35.3978333 -61.66229 -9.133381
## Drought Isolates-Control                    10.9518333 -15.31262 37.216286
## Nonfunctional Isolates-Control               1.0861667 -25.17829 27.350619
## Phosphorus Isolates-Control                  0.4120000 -25.85245 26.676452
## Nonfunctional Isolates-Drought Isolates     -9.8656667 -36.13012 16.398786
## Phosphorus Isolates-Drought Isolates       -10.5398333 -36.80429 15.724619
## Phosphorus Isolates-Nonfunctional Isolates  -0.6741667 -26.93862 25.590286
##                                                p adj
## Control-All Isolates                       0.0047088
## Drought Isolates-All Isolates              0.0690768
## Nonfunctional Isolates-All Isolates        0.0062166
## Phosphorus Isolates-All Isolates           0.0052328
## Drought Isolates-Control                   0.7244673
## Nonfunctional Isolates-Control             0.9999421
## Phosphorus Isolates-Control                0.9999988
## Nonfunctional Isolates-Drought Isolates    0.7921729
## Phosphorus Isolates-Drought Isolates       0.7508927
## Phosphorus Isolates-Nonfunctional Isolates 0.9999914
## 
## $`Condition:Treatment`
##                                                                            diff
## Well-watered:All Isolates-Drought:All Isolates                       -25.200333
## Drought:Control-Drought:All Isolates                                 -36.388667
## Well-watered:Control-Drought:All Isolates                            -60.431333
## Drought:Drought Isolates-Drought:All Isolates                        -34.496667
## Well-watered:Drought Isolates-Drought:All Isolates                   -40.419667
## Drought:Nonfunctional Isolates-Drought:All Isolates                  -40.706667
## Well-watered:Nonfunctional Isolates-Drought:All Isolates             -53.941000
## Drought:Phosphorus Isolates-Drought:All Isolates                     -43.877333
## Well-watered:Phosphorus Isolates-Drought:All Isolates                -52.118667
## Drought:Control-Well-watered:All Isolates                            -11.188333
## Well-watered:Control-Well-watered:All Isolates                       -35.231000
## Drought:Drought Isolates-Well-watered:All Isolates                    -9.296333
## Well-watered:Drought Isolates-Well-watered:All Isolates              -15.219333
## Drought:Nonfunctional Isolates-Well-watered:All Isolates             -15.506333
## Well-watered:Nonfunctional Isolates-Well-watered:All Isolates        -28.740667
## Drought:Phosphorus Isolates-Well-watered:All Isolates                -18.677000
## Well-watered:Phosphorus Isolates-Well-watered:All Isolates           -26.918333
## Well-watered:Control-Drought:Control                                 -24.042667
## Drought:Drought Isolates-Drought:Control                               1.892000
## Well-watered:Drought Isolates-Drought:Control                         -4.031000
## Drought:Nonfunctional Isolates-Drought:Control                        -4.318000
## Well-watered:Nonfunctional Isolates-Drought:Control                  -17.552333
## Drought:Phosphorus Isolates-Drought:Control                           -7.488667
## Well-watered:Phosphorus Isolates-Drought:Control                     -15.730000
## Drought:Drought Isolates-Well-watered:Control                         25.934667
## Well-watered:Drought Isolates-Well-watered:Control                    20.011667
## Drought:Nonfunctional Isolates-Well-watered:Control                   19.724667
## Well-watered:Nonfunctional Isolates-Well-watered:Control               6.490333
## Drought:Phosphorus Isolates-Well-watered:Control                      16.554000
## Well-watered:Phosphorus Isolates-Well-watered:Control                  8.312667
## Well-watered:Drought Isolates-Drought:Drought Isolates                -5.923000
## Drought:Nonfunctional Isolates-Drought:Drought Isolates               -6.210000
## Well-watered:Nonfunctional Isolates-Drought:Drought Isolates         -19.444333
## Drought:Phosphorus Isolates-Drought:Drought Isolates                  -9.380667
## Well-watered:Phosphorus Isolates-Drought:Drought Isolates            -17.622000
## Drought:Nonfunctional Isolates-Well-watered:Drought Isolates          -0.287000
## Well-watered:Nonfunctional Isolates-Well-watered:Drought Isolates    -13.521333
## Drought:Phosphorus Isolates-Well-watered:Drought Isolates             -3.457667
## Well-watered:Phosphorus Isolates-Well-watered:Drought Isolates       -11.699000
## Well-watered:Nonfunctional Isolates-Drought:Nonfunctional Isolates   -13.234333
## Drought:Phosphorus Isolates-Drought:Nonfunctional Isolates            -3.170667
## Well-watered:Phosphorus Isolates-Drought:Nonfunctional Isolates      -11.412000
## Drought:Phosphorus Isolates-Well-watered:Nonfunctional Isolates       10.063667
## Well-watered:Phosphorus Isolates-Well-watered:Nonfunctional Isolates   1.822333
## Well-watered:Phosphorus Isolates-Drought:Phosphorus Isolates          -8.241333
##                                                                             lwr
## Well-watered:All Isolates-Drought:All Isolates                        -69.15516
## Drought:Control-Drought:All Isolates                                  -80.34349
## Well-watered:Control-Drought:All Isolates                            -104.38616
## Drought:Drought Isolates-Drought:All Isolates                         -78.45149
## Well-watered:Drought Isolates-Drought:All Isolates                    -84.37449
## Drought:Nonfunctional Isolates-Drought:All Isolates                   -84.66149
## Well-watered:Nonfunctional Isolates-Drought:All Isolates              -97.89582
## Drought:Phosphorus Isolates-Drought:All Isolates                      -87.83216
## Well-watered:Phosphorus Isolates-Drought:All Isolates                 -96.07349
## Drought:Control-Well-watered:All Isolates                             -55.14316
## Well-watered:Control-Well-watered:All Isolates                        -79.18582
## Drought:Drought Isolates-Well-watered:All Isolates                    -53.25116
## Well-watered:Drought Isolates-Well-watered:All Isolates               -59.17416
## Drought:Nonfunctional Isolates-Well-watered:All Isolates              -59.46116
## Well-watered:Nonfunctional Isolates-Well-watered:All Isolates         -72.69549
## Drought:Phosphorus Isolates-Well-watered:All Isolates                 -62.63182
## Well-watered:Phosphorus Isolates-Well-watered:All Isolates            -70.87316
## Well-watered:Control-Drought:Control                                  -67.99749
## Drought:Drought Isolates-Drought:Control                              -42.06282
## Well-watered:Drought Isolates-Drought:Control                         -47.98582
## Drought:Nonfunctional Isolates-Drought:Control                        -48.27282
## Well-watered:Nonfunctional Isolates-Drought:Control                   -61.50716
## Drought:Phosphorus Isolates-Drought:Control                           -51.44349
## Well-watered:Phosphorus Isolates-Drought:Control                      -59.68482
## Drought:Drought Isolates-Well-watered:Control                         -18.02016
## Well-watered:Drought Isolates-Well-watered:Control                    -23.94316
## Drought:Nonfunctional Isolates-Well-watered:Control                   -24.23016
## Well-watered:Nonfunctional Isolates-Well-watered:Control              -37.46449
## Drought:Phosphorus Isolates-Well-watered:Control                      -27.40082
## Well-watered:Phosphorus Isolates-Well-watered:Control                 -35.64216
## Well-watered:Drought Isolates-Drought:Drought Isolates                -49.87782
## Drought:Nonfunctional Isolates-Drought:Drought Isolates               -50.16482
## Well-watered:Nonfunctional Isolates-Drought:Drought Isolates          -63.39916
## Drought:Phosphorus Isolates-Drought:Drought Isolates                  -53.33549
## Well-watered:Phosphorus Isolates-Drought:Drought Isolates             -61.57682
## Drought:Nonfunctional Isolates-Well-watered:Drought Isolates          -44.24182
## Well-watered:Nonfunctional Isolates-Well-watered:Drought Isolates     -57.47616
## Drought:Phosphorus Isolates-Well-watered:Drought Isolates             -47.41249
## Well-watered:Phosphorus Isolates-Well-watered:Drought Isolates        -55.65382
## Well-watered:Nonfunctional Isolates-Drought:Nonfunctional Isolates    -57.18916
## Drought:Phosphorus Isolates-Drought:Nonfunctional Isolates            -47.12549
## Well-watered:Phosphorus Isolates-Drought:Nonfunctional Isolates       -55.36682
## Drought:Phosphorus Isolates-Well-watered:Nonfunctional Isolates       -33.89116
## Well-watered:Phosphorus Isolates-Well-watered:Nonfunctional Isolates  -42.13249
## Well-watered:Phosphorus Isolates-Drought:Phosphorus Isolates          -52.19616
##                                                                              upr
## Well-watered:All Isolates-Drought:All Isolates                        18.7544901
## Drought:Control-Drought:All Isolates                                   7.5661568
## Well-watered:Control-Drought:All Isolates                            -16.4765099
## Drought:Drought Isolates-Drought:All Isolates                          9.4581568
## Well-watered:Drought Isolates-Drought:All Isolates                     3.5351568
## Drought:Nonfunctional Isolates-Drought:All Isolates                    3.2481568
## Well-watered:Nonfunctional Isolates-Drought:All Isolates              -9.9861766
## Drought:Phosphorus Isolates-Drought:All Isolates                       0.0774901
## Well-watered:Phosphorus Isolates-Drought:All Isolates                 -8.1638432
## Drought:Control-Well-watered:All Isolates                             32.7664901
## Well-watered:Control-Well-watered:All Isolates                         8.7238234
## Drought:Drought Isolates-Well-watered:All Isolates                    34.6584901
## Well-watered:Drought Isolates-Well-watered:All Isolates               28.7354901
## Drought:Nonfunctional Isolates-Well-watered:All Isolates              28.4484901
## Well-watered:Nonfunctional Isolates-Well-watered:All Isolates         15.2141568
## Drought:Phosphorus Isolates-Well-watered:All Isolates                 25.2778234
## Well-watered:Phosphorus Isolates-Well-watered:All Isolates            17.0364901
## Well-watered:Control-Drought:Control                                  19.9121568
## Drought:Drought Isolates-Drought:Control                              45.8468234
## Well-watered:Drought Isolates-Drought:Control                         39.9238234
## Drought:Nonfunctional Isolates-Drought:Control                        39.6368234
## Well-watered:Nonfunctional Isolates-Drought:Control                   26.4024901
## Drought:Phosphorus Isolates-Drought:Control                           36.4661568
## Well-watered:Phosphorus Isolates-Drought:Control                      28.2248234
## Drought:Drought Isolates-Well-watered:Control                         69.8894901
## Well-watered:Drought Isolates-Well-watered:Control                    63.9664901
## Drought:Nonfunctional Isolates-Well-watered:Control                   63.6794901
## Well-watered:Nonfunctional Isolates-Well-watered:Control              50.4451568
## Drought:Phosphorus Isolates-Well-watered:Control                      60.5088234
## Well-watered:Phosphorus Isolates-Well-watered:Control                 52.2674901
## Well-watered:Drought Isolates-Drought:Drought Isolates                38.0318234
## Drought:Nonfunctional Isolates-Drought:Drought Isolates               37.7448234
## Well-watered:Nonfunctional Isolates-Drought:Drought Isolates          24.5104901
## Drought:Phosphorus Isolates-Drought:Drought Isolates                  34.5741568
## Well-watered:Phosphorus Isolates-Drought:Drought Isolates             26.3328234
## Drought:Nonfunctional Isolates-Well-watered:Drought Isolates          43.6678234
## Well-watered:Nonfunctional Isolates-Well-watered:Drought Isolates     30.4334901
## Drought:Phosphorus Isolates-Well-watered:Drought Isolates             40.4971568
## Well-watered:Phosphorus Isolates-Well-watered:Drought Isolates        32.2558234
## Well-watered:Nonfunctional Isolates-Drought:Nonfunctional Isolates    30.7204901
## Drought:Phosphorus Isolates-Drought:Nonfunctional Isolates            40.7841568
## Well-watered:Phosphorus Isolates-Drought:Nonfunctional Isolates       32.5428234
## Drought:Phosphorus Isolates-Well-watered:Nonfunctional Isolates       54.0184901
## Well-watered:Phosphorus Isolates-Well-watered:Nonfunctional Isolates  45.7771568
## Well-watered:Phosphorus Isolates-Drought:Phosphorus Isolates          35.7134901
##                                                                          p adj
## Well-watered:All Isolates-Drought:All Isolates                       0.5898939
## Drought:Control-Drought:All Isolates                                 0.1604508
## Well-watered:Control-Drought:All Isolates                            0.0029134
## Drought:Drought Isolates-Drought:All Isolates                        0.2087756
## Well-watered:Drought Isolates-Drought:All Isolates                   0.0878770
## Drought:Nonfunctional Isolates-Drought:All Isolates                  0.0840372
## Well-watered:Nonfunctional Isolates-Drought:All Isolates             0.0091325
## Drought:Phosphorus Isolates-Drought:All Isolates                     0.0506365
## Well-watered:Phosphorus Isolates-Drought:All Isolates                0.0125483
## Drought:Control-Well-watered:All Isolates                            0.9946005
## Well-watered:Control-Well-watered:All Isolates                       0.1888093
## Drought:Drought Isolates-Well-watered:All Isolates                   0.9986372
## Well-watered:Drought Isolates-Well-watered:All Isolates              0.9589139
## Drought:Nonfunctional Isolates-Well-watered:All Isolates             0.9541233
## Well-watered:Nonfunctional Isolates-Well-watered:All Isolates        0.4208204
## Drought:Phosphorus Isolates-Well-watered:All Isolates                0.8751733
## Well-watered:Phosphorus Isolates-Well-watered:All Isolates           0.5057846
## Well-watered:Control-Drought:Control                                 0.6469344
## Drought:Drought Isolates-Drought:Control                             1.0000000
## Well-watered:Drought Isolates-Drought:Control                        0.9999987
## Drought:Nonfunctional Isolates-Drought:Control                       0.9999976
## Well-watered:Nonfunctional Isolates-Drought:Control                  0.9087740
## Drought:Phosphorus Isolates-Drought:Control                          0.9997535
## Well-watered:Phosphorus Isolates-Drought:Control                     0.9501329
## Drought:Drought Isolates-Well-watered:Control                        0.5536878
## Well-watered:Drought Isolates-Well-watered:Control                   0.8276459
## Drought:Nonfunctional Isolates-Well-watered:Control                  0.8385258
## Well-watered:Nonfunctional Isolates-Well-watered:Control             0.9999240
## Drought:Phosphorus Isolates-Well-watered:Control                     0.9334189
## Well-watered:Phosphorus Isolates-Well-watered:Control                0.9994306
## Well-watered:Drought Isolates-Drought:Drought Isolates               0.9999647
## Drought:Nonfunctional Isolates-Drought:Drought Isolates              0.9999474
## Well-watered:Nonfunctional Isolates-Drought:Drought Isolates         0.8488137
## Drought:Phosphorus Isolates-Drought:Drought Isolates                 0.9985395
## Well-watered:Phosphorus Isolates-Drought:Drought Isolates            0.9068716
## Drought:Nonfunctional Isolates-Well-watered:Drought Isolates         1.0000000
## Well-watered:Nonfunctional Isolates-Well-watered:Drought Isolates    0.9803061
## Drought:Phosphorus Isolates-Well-watered:Drought Isolates            0.9999997
## Well-watered:Phosphorus Isolates-Well-watered:Drought Isolates       0.9925906
## Well-watered:Nonfunctional Isolates-Drought:Nonfunctional Isolates   0.9828754
## Drought:Phosphorus Isolates-Drought:Nonfunctional Isolates           0.9999998
## Well-watered:Phosphorus Isolates-Drought:Nonfunctional Isolates      0.9937820
## Drought:Phosphorus Isolates-Well-watered:Nonfunctional Isolates      0.9975143
## Well-watered:Phosphorus Isolates-Well-watered:Nonfunctional Isolates 1.0000000
## Well-watered:Phosphorus Isolates-Drought:Phosphorus Isolates         0.9994682
# testing homogeneity of variances
plot(lipid.wk8.aov, 1)

leveneTest(LipidPerox ~ Condition*Treatment, data = lipid.wk8) # p > 0.05 means no violation of homogeneity of varaince
# normality test
plot(lipid.wk8.aov, 2)

lipid.wk8.residuals <- residuals(object = lipid.wk8.aov)
shapiro.test(x = lipid.wk8.residuals)
## 
##  Shapiro-Wilk normality test
## 
## data:  lipid.wk8.residuals
## W = 0.94322, p-value = 0.1111
lipid.boxplot <- ggplot(data = clusia.lipid, aes(x = Treatment, y = LipidPerox, fill = Condition)) + geom_boxplot() + geom_point(aes(fill = Condition), size = 2, shape = 21, position = position_jitterdodge()) + facet_grid(. ~ Week) 

lipid.boxplot <- lipid.boxplot + theme_bw() +scale_fill_manual(values=c("indianred3", "cadetblue3"), breaks=c("Well-watered", "Drought"),labels=c("Well-watered", "Drought")) + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank()) + theme(axis.title.x = element_blank()) + theme(axis.text.x = element_text(angle = 45, hjust = 1, vjust = 1)) + theme(legend.position = c(0.1, 0.8)) + ylab(expression(Lipid~Peroxidation~(nmol~MDA~g^{-1})))

lipid.boxplot <- lipid.boxplot + theme_bw() +scale_fill_manual(values=c("indianred3", "cadetblue3"), breaks=c("Well-watered", "Drought"),labels=c("Well-watered", "Drought")) + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank()) + theme(axis.title.x = element_blank()) + theme(axis.text.x = element_text(angle = 45, hjust = 1, vjust = 1)) + theme(legend.position = c(0.1, 0.8))
## Scale for 'fill' is already present. Adding another scale for 'fill',
## which will replace the existing scale.
pdf("LipidPerox_Boxplot.pdf")
plot(lipid.boxplot)
dev.off()
## quartz_off_screen 
##                 2

Lipd peroxidation did not differ signifcantly between well-watered plants and drought plants until the final week of the experiment. Overall, plants inoculated with all beneficial isolates (All Isolates) differed from control plants (Control), plants that received autoclaved bacteria (Control Mock), and plants that received isolates with no measured function (Nonfunctional) (p-value < 0.05). The greatest differences in lipid peroxidation occured between well-watered plants and drought plants, indepent of microbial community. Although there is a significant microbial effect (p-value < 0.01), there is no interaction term suggesting that lipid peroxidation in drought conditions is not tied to microbial community composition despite the general differences between plants incolated with beneficial isolates and those of the control.

Proline Assay

clusia.proline <- read.csv("~/Documents/Git/clusia_droughtexperiment/Proline.csv", header = TRUE , sep = ",", stringsAsFactors = TRUE, na.strings = "na")

Proline Controls

# Week 0
wk0.controls <- clusia.proline %>% 
  filter(Treatment == "Control" | Treatment == "Control Mock") %>% 
  filter(Week == "Wk_0") %>% 
  arrange(Condition, Treatment)

proline.control0.aov <- aov(Proline ~ Condition * Treatment, data = wk0.controls)
summary(proline.control0.aov) # not sigificant between autoclaved and inoculated controls
##                     Df Sum Sq Mean Sq F value Pr(>F)
## Condition            1   3.96   3.960   0.221  0.653
## Treatment            1  20.46  20.458   1.141  0.321
## Condition:Treatment  1   7.39   7.386   0.412  0.541
## Residuals            7 125.53  17.933
# Week 2
wk2.controls <- clusia.proline %>% 
  filter(Treatment == "Control" | Treatment == "Control Mock") %>% 
  filter(Week == "Wk_2") %>% 
  arrange(Condition, Treatment)

proline.control2.aov <- aov(Proline ~ Condition * Treatment, data = wk2.controls)
summary(proline.control2.aov) # not sigificant between autoclaved and inoculated controls
##                     Df Sum Sq Mean Sq F value Pr(>F)  
## Condition            1 161.52  161.52   6.444 0.0348 *
## Treatment            1   0.12    0.12   0.005 0.9456  
## Condition:Treatment  1   2.88    2.88   0.115 0.7433  
## Residuals            8 200.52   25.06                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Week 4
wk4.controls <- clusia.proline %>% 
  filter(Treatment == "Control" | Treatment == "Control Mock") %>% 
  filter(Week == "Wk_4") %>% 
  arrange(Condition, Treatment)

proline.control4.aov <- aov(Proline ~ Condition * Treatment, data = wk4.controls)
summary(proline.control4.aov) # significant interaction term + significant at < 0.1 for drought and microbial effect
##                     Df Sum Sq Mean Sq F value Pr(>F)  
## Condition            1  21.15  21.146   4.229 0.0855 .
## Treatment            1  23.07  23.074   4.614 0.0753 .
## Condition:Treatment  1  30.84  30.845   6.168 0.0476 *
## Residuals            6  30.00   5.001                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Week 6
wk6.controls <- clusia.proline %>% 
  filter(Treatment == "Control" | Treatment == "Control Mock") %>% 
  filter(Week == "Wk_6") %>% 
  arrange(Condition, Treatment)

proline.control6.aov <- aov(Proline ~ Condition * Treatment, data = wk6.controls)
summary(proline.control6.aov) # significant drought effect
##                     Df Sum Sq Mean Sq F value  Pr(>F)   
## Condition            1  510.5   510.5  17.722 0.00399 **
## Treatment            1    4.6     4.6   0.159 0.70219   
## Condition:Treatment  1   51.8    51.8   1.800 0.22164   
## Residuals            7  201.6    28.8                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Week 8
wk8.controls <- clusia.proline %>% 
  filter(Treatment == "Control" | Treatment == "Control Mock") %>% 
  filter(Week == "Wk_8") %>% 
  arrange(Condition, Treatment)

proline.control8.aov <- aov(Proline ~ Condition * Treatment, data = wk8.controls)
summary(proline.control8.aov) # significant drought effect
##                     Df Sum Sq Mean Sq F value   Pr(>F)    
## Condition            1  544.8   544.8  36.230 0.000317 ***
## Treatment            1   13.0    13.0   0.867 0.379007    
## Condition:Treatment  1   17.3    17.3   1.152 0.314418    
## Residuals            8  120.3    15.0                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# removing Control Mock & fixing 'Null isolates'
clusia.lipid <- clusia.lipid %>% 
  filter(Treatment != "Control Mock")

# arranging by Week, Water, and Treatment
clusia.lipid <- clusia.lipid %>% 
  arrange(Week, Condition, Treatment)

Mean, SD, Std. Error

proline.sum <- clusia.proline %>% 
  group_by(Week, Condition, Treatment) %>% 
  summarise(n = n(),
            mean_proline = mean(Proline, na.rm = TRUE),
            sd_proline = sd(Proline, na.rm = TRUE),
            se = sd(Proline, na.rm = TRUE)/sqrt(n()))
View(proline.sum)

proline.errobars <- ggplot(data = proline.sum, aes(x = Treatment, y = mean_proline, fill = Condition)) + geom_bar(stat = "identity", color = "black", position = position_dodge(0.9)) + geom_errorbar(aes(ymin = mean_proline-sd_proline, ymax = mean_proline+sd_proline), width = 0.2, position = position_dodge(0.9)) + facet_grid(. ~ Week)

proline.errobars <- proline.errobars + theme_bw() + scale_fill_manual(values=c("indianred3", "cadetblue3"), breaks=c("Well-watered", "Drought"),labels=c("Well-watered", "Drought")) + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank()) + theme(axis.title.x = element_blank()) + theme(axis.text.x = element_text(angle = 45, hjust = 1, vjust = 1)) + theme(legend.position = c(0.09, 0.85)) + ylab(expression(Mean~Proline~Concentration(mu~moles~g^{-1})))

proline.errobars
## Warning: Removed 1 rows containing missing values (geom_errorbar).

Proline ANOVAs

Week 0

# Week 0
proline.wk0 <- clusia.proline %>% 
  filter(Week == "Wk_0")

# density histogram
ggplot(data = proline.wk0, aes(x = Proline)) + geom_histogram(binwidth = 2, aes(y =..density..), colour = "black", fill = "white") + geom_density(alpha = 0.2, fill = "#FF6666") 

# by water treatment
proline.wk0.mu <- proline.wk0 %>% 
  group_by(Condition) %>% 
  summarise(mean = mean(Proline, na.rm = TRUE))

ggplot(data = proline.wk0, aes(x = Proline, fill = Condition)) + geom_histogram(binwidth = 2, position = "identity", alpha = 0.5) + geom_vline(data = proline.wk0.mu, aes(xintercept=mean, color=Condition), linetype="dashed") + scale_color_manual(values=c("indianred3", "cadetblue3")) + theme_classic() + xlab("Proline") + ylab("Count") + theme(legend.position = c(0.9, 0.9))

# ANOVA
proline.wk0.aov <- aov(Proline ~ Condition * Treatment, data = proline.wk0)
summary(proline.wk0.aov) 
##                     Df Sum Sq Mean Sq F value Pr(>F)
## Condition            1   16.4  16.435   0.769  0.390
## Treatment            5   42.7   8.536   0.399  0.844
## Condition:Treatment  5   43.0   8.610   0.403  0.842
## Residuals           23  491.7  21.380
# testing homogeneity of variances
plot(proline.wk0.aov, 1)

leveneTest(Proline ~ Condition*Treatment, data = proline.wk0) 
# normality test
plot(proline.wk0.aov, 2)

proline.wk0.residuals <- residuals(object = proline.wk0.aov)
shapiro.test(x = proline.wk0.residuals)
## 
##  Shapiro-Wilk normality test
## 
## data:  proline.wk0.residuals
## W = 0.97952, p-value = 0.7435

Week 2

# Week 2
proline.wk2 <- clusia.proline %>% 
  filter(Week == "Wk_2")

# ANOVA
proline.wk2.aov <- aov(Proline ~ Condition * Treatment, data = proline.wk2)
summary(proline.wk2.aov) # significant drought effect (<0.1) and interaction term (< 0.05)
##                     Df Sum Sq Mean Sq F value Pr(>F)  
## Condition            1  45.18   45.18   3.425 0.0771 .
## Treatment            5  56.29   11.26   0.854 0.5266  
## Condition:Treatment  5 204.85   40.97   3.106 0.0275 *
## Residuals           23 303.37   13.19                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Week 4

# Week 4
proline.wk4 <- clusia.proline %>% 
  filter(Week == "Wk_4")

# density histogram
ggplot(data = proline.wk4, aes(x = Proline)) + geom_histogram(binwidth = 2.5, aes(y =..density..), colour = "black", fill = "white") + geom_density(alpha = 0.2, fill = "#FF6666") 

# by water treatment
proline.wk4.mu <- proline.wk4 %>% 
  group_by(Condition) %>% 
  summarise(mean = mean(Proline, na.rm = TRUE))

ggplot(data = proline.wk4, aes(x = Proline, fill = Condition)) + geom_histogram(binwidth = 2.5, position = "identity", alpha = 0.5) + geom_vline(data = proline.wk4.mu, aes(xintercept=mean, color=Condition), linetype="dashed") + scale_color_manual(values=c("indianred3", "cadetblue3")) + theme_classic() + xlab("Proline") + ylab("Count") + theme(legend.position = c(0.9, 0.9))

# ANOVA
proline.wk4.aov <- aov(Proline ~ Condition * Treatment, data = proline.wk4)
summary(proline.wk4.aov) # significant drought effect
##                     Df Sum Sq Mean Sq F value Pr(>F)  
## Condition            1  133.5  133.48   6.883 0.0167 *
## Treatment            5   87.2   17.45   0.900 0.5014  
## Condition:Treatment  5   61.2   12.24   0.631 0.6782  
## Residuals           19  368.4   19.39                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# testing homogeneity of variances
plot(proline.wk4.aov, 1)

leveneTest(Proline ~ Condition*Treatment, data = proline.wk4)
# normality test
plot(proline.wk4.aov, 2)
## Warning: not plotting observations with leverage one:
##   24

proline.wk4.residuals <- residuals(object = proline.wk4.aov)
shapiro.test(x = proline.wk4.residuals)
## 
##  Shapiro-Wilk normality test
## 
## data:  proline.wk4.residuals
## W = 0.96447, p-value = 0.381

Week 6

proline.wk6 <- clusia.proline %>% 
  filter(Week == "Wk_6")

proline.wk6.aov <- aov(Proline ~ Condition * Treatment, data = proline.wk6)
summary(proline.wk6.aov)  # significant drought effect (<0.001), microbial (<0.1), interaction (<0.1)
##                     Df Sum Sq Mean Sq F value   Pr(>F)    
## Condition            1 1240.6  1240.6  36.804 2.44e-06 ***
## Treatment            5  407.4    81.5   2.417   0.0642 .  
## Condition:Treatment  5  371.5    74.3   2.204   0.0858 .  
## Residuals           25  842.7    33.7                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
TukeyHSD(proline.wk6.aov)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = Proline ~ Condition * Treatment, data = proline.wk6)
## 
## $Condition
##                          diff       lwr       upr   p adj
## Well-watered-Drought -11.5851 -15.51809 -7.652106 2.4e-06
## 
## $Treatment
##                                                  diff        lwr
## Control-All Isolates                       -4.8047972 -15.281487
## Control Mock-All Isolates                  -5.8835069 -15.837894
## Drought Isolates-All Isolates              -3.0572995 -12.621165
## Nonfunctional Isolates-All Isolates        -9.2510069 -19.205394
## Phosphorus Isolates-All Isolates           -8.9371736 -18.891561
## Control Mock-Control                       -1.0787096 -11.913068
## Drought Isolates-Control                    1.7474977  -8.729192
## Nonfunctional Isolates-Control             -4.4462096 -15.280568
## Phosphorus Isolates-Control                -4.1323763 -14.966735
## Drought Isolates-Control Mock               2.8262074  -7.128180
## Nonfunctional Isolates-Control Mock        -3.3675000 -13.697656
## Phosphorus Isolates-Control Mock           -3.0536667 -13.383822
## Nonfunctional Isolates-Drought Isolates    -6.1937074 -16.148094
## Phosphorus Isolates-Drought Isolates       -5.8798741 -15.834261
## Phosphorus Isolates-Nonfunctional Isolates  0.3138333 -10.016322
##                                                   upr     p adj
## Control-All Isolates                        5.6718928 0.7189041
## Control Mock-All Isolates                   4.0708802 0.4708478
## Drought Isolates-All Isolates               6.5065662 0.9184005
## Nonfunctional Isolates-All Isolates         0.7033802 0.0793997
## Phosphorus Isolates-All Isolates            1.0172135 0.0968288
## Control Mock-Control                        9.7556490 0.9995874
## Drought Isolates-Control                   12.2241877 0.9951258
## Nonfunctional Isolates-Control              6.3881490 0.8007091
## Phosphorus Isolates-Control                 6.7019823 0.8441368
## Drought Isolates-Control Mock              12.7805945 0.9490482
## Nonfunctional Isolates-Control Mock         6.9626557 0.9120373
## Phosphorus Isolates-Control Mock            7.2764890 0.9400229
## Nonfunctional Isolates-Drought Isolates     3.7606797 0.4153427
## Phosphorus Isolates-Drought Isolates        4.0745130 0.4715137
## Phosphorus Isolates-Nonfunctional Isolates 10.6439890 0.9999988
## 
## $`Condition:Treatment`
##                                                                             diff
## Well-watered:All Isolates-Drought:All Isolates                       -18.9151667
## Drought:Control-Drought:All Isolates                                  -4.7186667
## Well-watered:Control-Drought:All Isolates                            -23.4283333
## Drought:Control Mock-Drought:All Isolates                            -10.9186667
## Well-watered:Control Mock-Drought:All Isolates                       -20.8106667
## Drought:Drought Isolates-Drought:All Isolates                        -11.5366667
## Well-watered:Drought Isolates-Drought:All Isolates                   -13.1100000
## Drought:Nonfunctional Isolates-Drought:All Isolates                  -11.5086667
## Well-watered:Nonfunctional Isolates-Drought:All Isolates             -26.9556667
## Drought:Phosphorus Isolates-Drought:All Isolates                     -14.9636667
## Well-watered:Phosphorus Isolates-Drought:All Isolates                -22.8730000
## Drought:Control-Well-watered:All Isolates                             14.1965000
## Well-watered:Control-Well-watered:All Isolates                        -4.5131667
## Drought:Control Mock-Well-watered:All Isolates                         7.9965000
## Well-watered:Control Mock-Well-watered:All Isolates                   -1.8955000
## Drought:Drought Isolates-Well-watered:All Isolates                     7.3785000
## Well-watered:Drought Isolates-Well-watered:All Isolates                5.8051667
## Drought:Nonfunctional Isolates-Well-watered:All Isolates               7.4065000
## Well-watered:Nonfunctional Isolates-Well-watered:All Isolates         -8.0405000
## Drought:Phosphorus Isolates-Well-watered:All Isolates                  3.9515000
## Well-watered:Phosphorus Isolates-Well-watered:All Isolates            -3.9578333
## Well-watered:Control-Drought:Control                                 -18.7096667
## Drought:Control Mock-Drought:Control                                  -6.2000000
## Well-watered:Control Mock-Drought:Control                            -16.0920000
## Drought:Drought Isolates-Drought:Control                              -6.8180000
## Well-watered:Drought Isolates-Drought:Control                         -8.3913333
## Drought:Nonfunctional Isolates-Drought:Control                        -6.7900000
## Well-watered:Nonfunctional Isolates-Drought:Control                  -22.2370000
## Drought:Phosphorus Isolates-Drought:Control                          -10.2450000
## Well-watered:Phosphorus Isolates-Drought:Control                     -18.1543333
## Drought:Control Mock-Well-watered:Control                             12.5096667
## Well-watered:Control Mock-Well-watered:Control                         2.6176667
## Drought:Drought Isolates-Well-watered:Control                         11.8916667
## Well-watered:Drought Isolates-Well-watered:Control                    10.3183333
## Drought:Nonfunctional Isolates-Well-watered:Control                   11.9196667
## Well-watered:Nonfunctional Isolates-Well-watered:Control              -3.5273333
## Drought:Phosphorus Isolates-Well-watered:Control                       8.4646667
## Well-watered:Phosphorus Isolates-Well-watered:Control                  0.5553333
## Well-watered:Control Mock-Drought:Control Mock                        -9.8920000
## Drought:Drought Isolates-Drought:Control Mock                         -0.6180000
## Well-watered:Drought Isolates-Drought:Control Mock                    -2.1913333
## Drought:Nonfunctional Isolates-Drought:Control Mock                   -0.5900000
## Well-watered:Nonfunctional Isolates-Drought:Control Mock             -16.0370000
## Drought:Phosphorus Isolates-Drought:Control Mock                      -4.0450000
## Well-watered:Phosphorus Isolates-Drought:Control Mock                -11.9543333
## Drought:Drought Isolates-Well-watered:Control Mock                     9.2740000
## Well-watered:Drought Isolates-Well-watered:Control Mock                7.7006667
## Drought:Nonfunctional Isolates-Well-watered:Control Mock               9.3020000
## Well-watered:Nonfunctional Isolates-Well-watered:Control Mock         -6.1450000
## Drought:Phosphorus Isolates-Well-watered:Control Mock                  5.8470000
## Well-watered:Phosphorus Isolates-Well-watered:Control Mock            -2.0623333
## Well-watered:Drought Isolates-Drought:Drought Isolates                -1.5733333
## Drought:Nonfunctional Isolates-Drought:Drought Isolates                0.0280000
## Well-watered:Nonfunctional Isolates-Drought:Drought Isolates         -15.4190000
## Drought:Phosphorus Isolates-Drought:Drought Isolates                  -3.4270000
## Well-watered:Phosphorus Isolates-Drought:Drought Isolates            -11.3363333
## Drought:Nonfunctional Isolates-Well-watered:Drought Isolates           1.6013333
## Well-watered:Nonfunctional Isolates-Well-watered:Drought Isolates    -13.8456667
## Drought:Phosphorus Isolates-Well-watered:Drought Isolates             -1.8536667
## Well-watered:Phosphorus Isolates-Well-watered:Drought Isolates        -9.7630000
## Well-watered:Nonfunctional Isolates-Drought:Nonfunctional Isolates   -15.4470000
## Drought:Phosphorus Isolates-Drought:Nonfunctional Isolates            -3.4550000
## Well-watered:Phosphorus Isolates-Drought:Nonfunctional Isolates      -11.3643333
## Drought:Phosphorus Isolates-Well-watered:Nonfunctional Isolates       11.9920000
## Well-watered:Phosphorus Isolates-Well-watered:Nonfunctional Isolates   4.0826667
## Well-watered:Phosphorus Isolates-Drought:Phosphorus Isolates          -7.9093333
##                                                                             lwr
## Well-watered:All Isolates-Drought:All Isolates                       -34.841512
## Drought:Control-Drought:All Isolates                                 -23.754291
## Well-watered:Control-Drought:All Isolates                            -40.454313
## Drought:Control Mock-Drought:All Isolates                            -27.944647
## Well-watered:Control Mock-Drought:All Isolates                       -37.836647
## Drought:Drought Isolates-Drought:All Isolates                        -27.463012
## Well-watered:Drought Isolates-Drought:All Isolates                   -30.135980
## Drought:Nonfunctional Isolates-Drought:All Isolates                  -28.534647
## Well-watered:Nonfunctional Isolates-Drought:All Isolates             -43.981647
## Drought:Phosphorus Isolates-Drought:All Isolates                     -31.989647
## Well-watered:Phosphorus Isolates-Drought:All Isolates                -39.898980
## Drought:Control-Well-watered:All Isolates                             -3.862279
## Well-watered:Control-Well-watered:All Isolates                       -20.439512
## Drought:Control Mock-Well-watered:All Isolates                        -7.929846
## Well-watered:Control Mock-Well-watered:All Isolates                  -17.821846
## Drought:Drought Isolates-Well-watered:All Isolates                    -7.366431
## Well-watered:Drought Isolates-Well-watered:All Isolates              -10.121179
## Drought:Nonfunctional Isolates-Well-watered:All Isolates              -8.519846
## Well-watered:Nonfunctional Isolates-Well-watered:All Isolates        -23.966846
## Drought:Phosphorus Isolates-Well-watered:All Isolates                -11.974846
## Well-watered:Phosphorus Isolates-Well-watered:All Isolates           -19.884179
## Well-watered:Control-Drought:Control                                 -37.745291
## Drought:Control Mock-Drought:Control                                 -25.235624
## Well-watered:Control Mock-Drought:Control                            -35.127624
## Drought:Drought Isolates-Drought:Control                             -24.876779
## Well-watered:Drought Isolates-Drought:Control                        -27.426957
## Drought:Nonfunctional Isolates-Drought:Control                       -25.825624
## Well-watered:Nonfunctional Isolates-Drought:Control                  -41.272624
## Drought:Phosphorus Isolates-Drought:Control                          -29.280624
## Well-watered:Phosphorus Isolates-Drought:Control                     -37.189957
## Drought:Control Mock-Well-watered:Control                             -4.516313
## Well-watered:Control Mock-Well-watered:Control                       -14.408313
## Drought:Drought Isolates-Well-watered:Control                         -4.034679
## Well-watered:Drought Isolates-Well-watered:Control                    -6.707647
## Drought:Nonfunctional Isolates-Well-watered:Control                   -5.106313
## Well-watered:Nonfunctional Isolates-Well-watered:Control             -20.553313
## Drought:Phosphorus Isolates-Well-watered:Control                      -8.561313
## Well-watered:Phosphorus Isolates-Well-watered:Control                -16.470647
## Well-watered:Control Mock-Drought:Control Mock                       -26.917980
## Drought:Drought Isolates-Drought:Control Mock                        -16.544346
## Well-watered:Drought Isolates-Drought:Control Mock                   -19.217313
## Drought:Nonfunctional Isolates-Drought:Control Mock                  -17.615980
## Well-watered:Nonfunctional Isolates-Drought:Control Mock             -33.062980
## Drought:Phosphorus Isolates-Drought:Control Mock                     -21.070980
## Well-watered:Phosphorus Isolates-Drought:Control Mock                -28.980313
## Drought:Drought Isolates-Well-watered:Control Mock                    -6.652346
## Well-watered:Drought Isolates-Well-watered:Control Mock               -9.325313
## Drought:Nonfunctional Isolates-Well-watered:Control Mock              -7.723980
## Well-watered:Nonfunctional Isolates-Well-watered:Control Mock        -23.170980
## Drought:Phosphorus Isolates-Well-watered:Control Mock                -11.178980
## Well-watered:Phosphorus Isolates-Well-watered:Control Mock           -19.088313
## Well-watered:Drought Isolates-Drought:Drought Isolates               -17.499679
## Drought:Nonfunctional Isolates-Drought:Drought Isolates              -15.898346
## Well-watered:Nonfunctional Isolates-Drought:Drought Isolates         -31.345346
## Drought:Phosphorus Isolates-Drought:Drought Isolates                 -19.353346
## Well-watered:Phosphorus Isolates-Drought:Drought Isolates            -27.262679
## Drought:Nonfunctional Isolates-Well-watered:Drought Isolates         -15.424647
## Well-watered:Nonfunctional Isolates-Well-watered:Drought Isolates    -30.871647
## Drought:Phosphorus Isolates-Well-watered:Drought Isolates            -18.879647
## Well-watered:Phosphorus Isolates-Well-watered:Drought Isolates       -26.788980
## Well-watered:Nonfunctional Isolates-Drought:Nonfunctional Isolates   -32.472980
## Drought:Phosphorus Isolates-Drought:Nonfunctional Isolates           -20.480980
## Well-watered:Phosphorus Isolates-Drought:Nonfunctional Isolates      -28.390313
## Drought:Phosphorus Isolates-Well-watered:Nonfunctional Isolates       -5.033980
## Well-watered:Phosphorus Isolates-Well-watered:Nonfunctional Isolates -12.943313
## Well-watered:Phosphorus Isolates-Drought:Phosphorus Isolates         -24.935313
##                                                                             upr
## Well-watered:All Isolates-Drought:All Isolates                       -2.9888208
## Drought:Control-Drought:All Isolates                                 14.3169575
## Well-watered:Control-Drought:All Isolates                            -6.4023535
## Drought:Control Mock-Drought:All Isolates                             6.1073132
## Well-watered:Control Mock-Drought:All Isolates                       -3.7846868
## Drought:Drought Isolates-Drought:All Isolates                         4.3896792
## Well-watered:Drought Isolates-Drought:All Isolates                    3.9159799
## Drought:Nonfunctional Isolates-Drought:All Isolates                   5.5173132
## Well-watered:Nonfunctional Isolates-Drought:All Isolates             -9.9296868
## Drought:Phosphorus Isolates-Drought:All Isolates                      2.0623132
## Well-watered:Phosphorus Isolates-Drought:All Isolates                -5.8470201
## Drought:Control-Well-watered:All Isolates                            32.2552787
## Well-watered:Control-Well-watered:All Isolates                       11.4131792
## Drought:Control Mock-Well-watered:All Isolates                       23.9228458
## Well-watered:Control Mock-Well-watered:All Isolates                  14.0308458
## Drought:Drought Isolates-Well-watered:All Isolates                   22.1234311
## Well-watered:Drought Isolates-Well-watered:All Isolates              21.7315125
## Drought:Nonfunctional Isolates-Well-watered:All Isolates             23.3328458
## Well-watered:Nonfunctional Isolates-Well-watered:All Isolates         7.8858458
## Drought:Phosphorus Isolates-Well-watered:All Isolates                19.8778458
## Well-watered:Phosphorus Isolates-Well-watered:All Isolates           11.9685125
## Well-watered:Control-Drought:Control                                  0.3259575
## Drought:Control Mock-Drought:Control                                 12.8356242
## Well-watered:Control Mock-Drought:Control                             2.9436242
## Drought:Drought Isolates-Drought:Control                             11.2407787
## Well-watered:Drought Isolates-Drought:Control                        10.6442908
## Drought:Nonfunctional Isolates-Drought:Control                       12.2456242
## Well-watered:Nonfunctional Isolates-Drought:Control                  -3.2013758
## Drought:Phosphorus Isolates-Drought:Control                           8.7906242
## Well-watered:Phosphorus Isolates-Drought:Control                      0.8812908
## Drought:Control Mock-Well-watered:Control                            29.5356465
## Well-watered:Control Mock-Well-watered:Control                       19.6436465
## Drought:Drought Isolates-Well-watered:Control                        27.8180125
## Well-watered:Drought Isolates-Well-watered:Control                   27.3443132
## Drought:Nonfunctional Isolates-Well-watered:Control                  28.9456465
## Well-watered:Nonfunctional Isolates-Well-watered:Control             13.4986465
## Drought:Phosphorus Isolates-Well-watered:Control                     25.4906465
## Well-watered:Phosphorus Isolates-Well-watered:Control                17.5813132
## Well-watered:Control Mock-Drought:Control Mock                        7.1339799
## Drought:Drought Isolates-Drought:Control Mock                        15.3083458
## Well-watered:Drought Isolates-Drought:Control Mock                   14.8346465
## Drought:Nonfunctional Isolates-Drought:Control Mock                  16.4359799
## Well-watered:Nonfunctional Isolates-Drought:Control Mock              0.9889799
## Drought:Phosphorus Isolates-Drought:Control Mock                     12.9809799
## Well-watered:Phosphorus Isolates-Drought:Control Mock                 5.0716465
## Drought:Drought Isolates-Well-watered:Control Mock                   25.2003458
## Well-watered:Drought Isolates-Well-watered:Control Mock              24.7266465
## Drought:Nonfunctional Isolates-Well-watered:Control Mock             26.3279799
## Well-watered:Nonfunctional Isolates-Well-watered:Control Mock        10.8809799
## Drought:Phosphorus Isolates-Well-watered:Control Mock                22.8729799
## Well-watered:Phosphorus Isolates-Well-watered:Control Mock           14.9636465
## Well-watered:Drought Isolates-Drought:Drought Isolates               14.3530125
## Drought:Nonfunctional Isolates-Drought:Drought Isolates              15.9543458
## Well-watered:Nonfunctional Isolates-Drought:Drought Isolates          0.5073458
## Drought:Phosphorus Isolates-Drought:Drought Isolates                 12.4993458
## Well-watered:Phosphorus Isolates-Drought:Drought Isolates             4.5900125
## Drought:Nonfunctional Isolates-Well-watered:Drought Isolates         18.6273132
## Well-watered:Nonfunctional Isolates-Well-watered:Drought Isolates     3.1803132
## Drought:Phosphorus Isolates-Well-watered:Drought Isolates            15.1723132
## Well-watered:Phosphorus Isolates-Well-watered:Drought Isolates        7.2629799
## Well-watered:Nonfunctional Isolates-Drought:Nonfunctional Isolates    1.5789799
## Drought:Phosphorus Isolates-Drought:Nonfunctional Isolates           13.5709799
## Well-watered:Phosphorus Isolates-Drought:Nonfunctional Isolates       5.6616465
## Drought:Phosphorus Isolates-Well-watered:Nonfunctional Isolates      29.0179799
## Well-watered:Phosphorus Isolates-Well-watered:Nonfunctional Isolates 21.1086465
## Well-watered:Phosphorus Isolates-Drought:Phosphorus Isolates          9.1166465
##                                                                          p adj
## Well-watered:All Isolates-Drought:All Isolates                       0.0106562
## Drought:Control-Drought:All Isolates                                 0.9986294
## Well-watered:Control-Drought:All Isolates                            0.0020620
## Drought:Control Mock-Drought:All Isolates                            0.4992419
## Well-watered:Control Mock-Drought:All Isolates                       0.0079152
## Drought:Drought Isolates-Drought:All Isolates                        0.3294478
## Well-watered:Drought Isolates-Drought:All Isolates                   0.2529134
## Drought:Nonfunctional Isolates-Drought:All Isolates                  0.4244338
## Well-watered:Nonfunctional Isolates-Drought:All Isolates             0.0003285
## Drought:Phosphorus Isolates-Drought:All Isolates                     0.1236067
## Well-watered:Phosphorus Isolates-Drought:All Isolates                0.0027496
## Drought:Control-Well-watered:All Isolates                            0.2290954
## Well-watered:Control-Well-watered:All Isolates                       0.9956679
## Drought:Control Mock-Well-watered:All Isolates                       0.8017581
## Well-watered:Control Mock-Well-watered:All Isolates                  0.9999990
## Drought:Drought Isolates-Well-watered:All Isolates                   0.8048958
## Well-watered:Drought Isolates-Well-watered:All Isolates              0.9700448
## Drought:Nonfunctional Isolates-Well-watered:All Isolates             0.8651719
## Well-watered:Nonfunctional Isolates-Well-watered:All Isolates        0.7965601
## Drought:Phosphorus Isolates-Well-watered:All Isolates                0.9986183
## Well-watered:Phosphorus Isolates-Well-watered:All Isolates           0.9985986
## Well-watered:Control-Drought:Control                                 0.0571389
## Drought:Control Mock-Drought:Control                                 0.9868404
## Well-watered:Control Mock-Drought:Control                            0.1558471
## Drought:Drought Isolates-Drought:Control                             0.9618607
## Well-watered:Drought Isolates-Drought:Control                        0.8996163
## Drought:Nonfunctional Isolates-Drought:Control                       0.9742791
## Well-watered:Nonfunctional Isolates-Drought:Control                  0.0125815
## Drought:Phosphorus Isolates-Drought:Control                          0.7296076
## Well-watered:Phosphorus Isolates-Drought:Control                     0.0714522
## Drought:Control Mock-Well-watered:Control                            0.3108945
## Well-watered:Control Mock-Well-watered:Control                       0.9999858
## Drought:Drought Isolates-Well-watered:Control                        0.2903827
## Well-watered:Drought Isolates-Well-watered:Control                   0.5787270
## Drought:Nonfunctional Isolates-Well-watered:Control                  0.3754711
## Well-watered:Nonfunctional Isolates-Well-watered:Control             0.9997356
## Drought:Phosphorus Isolates-Well-watered:Control                     0.8108849
## Well-watered:Phosphorus Isolates-Well-watered:Control                1.0000000
## Well-watered:Control Mock-Drought:Control Mock                       0.6355962
## Drought:Drought Isolates-Drought:Control Mock                        1.0000000
## Well-watered:Drought Isolates-Drought:Control Mock                   0.9999977
## Drought:Nonfunctional Isolates-Drought:Control Mock                  1.0000000
## Well-watered:Nonfunctional Isolates-Drought:Control Mock             0.0780933
## Drought:Phosphorus Isolates-Drought:Control Mock                     0.9990626
## Well-watered:Phosphorus Isolates-Drought:Control Mock                0.3714821
## Drought:Drought Isolates-Well-watered:Control Mock                   0.6326336
## Well-watered:Drought Isolates-Well-watered:Control Mock              0.8840431
## Drought:Nonfunctional Isolates-Well-watered:Control Mock             0.7122677
## Well-watered:Nonfunctional Isolates-Well-watered:Control Mock        0.9720479
## Drought:Phosphorus Isolates-Well-watered:Control Mock                0.9804445
## Well-watered:Phosphorus Isolates-Well-watered:Control Mock           0.9999988
## Well-watered:Drought Isolates-Drought:Drought Isolates               0.9999999
## Drought:Nonfunctional Isolates-Drought:Drought Isolates              1.0000000
## Well-watered:Nonfunctional Isolates-Drought:Drought Isolates         0.0640073
## Drought:Phosphorus Isolates-Drought:Drought Isolates                 0.9996225
## Well-watered:Phosphorus Isolates-Drought:Drought Isolates            0.3528499
## Drought:Nonfunctional Isolates-Well-watered:Drought Isolates         0.9999999
## Well-watered:Nonfunctional Isolates-Well-watered:Drought Isolates    0.1928909
## Drought:Phosphorus Isolates-Well-watered:Drought Isolates            0.9999996
## Well-watered:Phosphorus Isolates-Well-watered:Drought Isolates       0.6526540
## Well-watered:Nonfunctional Isolates-Drought:Nonfunctional Isolates   0.1008700
## Drought:Phosphorus Isolates-Drought:Nonfunctional Isolates           0.9997828
## Well-watered:Phosphorus Isolates-Drought:Nonfunctional Isolates      0.4422979
## Drought:Phosphorus Isolates-Well-watered:Nonfunctional Isolates      0.3671742
## Well-watered:Phosphorus Isolates-Well-watered:Nonfunctional Isolates 0.9989810
## Well-watered:Phosphorus Isolates-Drought:Phosphorus Isolates         0.8659447

Week 8

# Week 8
proline.wk8 <- clusia.proline %>% 
  filter(Week == "Wk_8")

# density histogram
ggplot(data = proline.wk8, aes(x = Proline)) + geom_histogram(binwidth = 4.5, aes(y =..density..), colour = "black", fill = "white") + geom_density(alpha = 0.2, fill = "#FF6666") 

# by water treatment
proline.wk8.mu <- proline.wk8 %>% 
  group_by(Condition) %>% 
  summarise(mean = mean(Proline, na.rm = TRUE))

ggplot(data = proline.wk8, aes(x = Proline, fill = Condition)) + geom_histogram(binwidth = 4.5, position = "identity", alpha = 0.5) + geom_vline(data = proline.wk8.mu, aes(xintercept=mean, color=Condition), linetype="dashed") + scale_color_manual(values=c("indianred3", "cadetblue3")) + theme_classic() + xlab("Proline") + ylab("Count") + theme(legend.position = c(0.9, 0.9))

# ANOVA
proline.wk8.aov <- aov(Proline ~ Condition * Treatment, data = proline.wk8)
summary(proline.wk8.aov) # significant drought effect (<0.001) and microbial effect (<0.1)
##                     Df Sum Sq Mean Sq F value   Pr(>F)    
## Condition            1 1154.6  1154.6  48.609 3.29e-07 ***
## Treatment            5  257.5    51.5   2.168   0.0916 .  
## Condition:Treatment  5  117.1    23.4   0.986   0.4467    
## Residuals           24  570.0    23.8                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# testing homogeneity of variances
plot(proline.wk8.aov, 1)

leveneTest(Proline ~ Condition*Treatment, data = proline.wk8) # p > 0.05 means no violation of homogeneity of varaince
# normality test
plot(proline.wk8.aov, 2)

proline.wk8.residuals <- residuals(object = proline.wk8.aov)  # p > 0.05 means no violation of homogeneity of varaince
shapiro.test(x = proline.wk8.residuals)
## 
##  Shapiro-Wilk normality test
## 
## data:  proline.wk8.residuals
## W = 0.98609, p-value = 0.922
proline.boxplot <- ggplot(data = clusia.proline, aes(x = Treatment, y = Proline, fill = Condition)) + geom_boxplot() + geom_point(aes(fill = Condition), size = 2, shape = 21, position = position_jitterdodge()) + facet_grid(. ~ Week) 

proline.boxplot <- proline.boxplot + theme_bw() +scale_fill_manual(values=c("indianred3", "cadetblue3"), breaks=c("Well-watered", "Drought"),labels=c("Well-watered", "Drought")) + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank()) + theme(axis.title.x = element_blank()) + theme(axis.text.x = element_text(angle = 45, hjust = 1, vjust = 1)) + theme(legend.position = c(0.09, 0.85))

pdf("Proline_Boxplot.pdf")
plot(proline.boxplot)
dev.off()
## quartz_off_screen 
##                 2

Water is predominantly the determinant of proline concentration, though not until Week 4. Unlike malic acid and lipid peroxidation, there is a slight influence of microbial community on proline in Week 6 and Week 8 (p-value < 0.1), though Tukeys HSD shows that these differences are the result of differences between well-watered communities and droughted communities. Therefore, the significant interaction term is not an indication that plants containing each constructed communities respond differently within the drought treatment. Well-watered plants have significantly lower amounts of proline than drought plants at Week 4 (p-value < 0.05), with the gap between the two widening over time. This is consistent with proline being a stress metabolite that increases in response to drought stress.

Osmolality

osmo <- read.csv("~/Documents/LabStats/Clusia/Osmolality.csv", header = TRUE, stringsAsFactors = TRUE)
osmo <- osmo %>% 
  arrange(Week, Condition, Treatment)

Controls

# Week 0
wk0.cont <- osmo %>% 
  filter(Treatment == "Control" | Treatment == "Control Mock") %>% 
  filter(Week == "Wk_0")


wk0.cont.aov <- aov(Osmolality ~ Condition * Treatment, data = wk0.cont)
summary(wk0.cont.aov) # no significant differences between control mock and control
##                     Df Sum Sq Mean Sq F value Pr(>F)
## Condition            1    107     107   0.024  0.880
## Treatment            1   1574    1574   0.358  0.569
## Condition:Treatment  1   5541    5541   1.259  0.299
## Residuals            7  30811    4402
# Week 2
wk2.cont <- osmo %>% 
  filter(Treatment == "Control" | Treatment == "Control Mock") %>% 
  filter(Week == "Wk_2")

wk2.cont.aov <- aov(Osmolality ~ Condition * Treatment, data = wk2.cont)
summary(wk2.cont.aov) # no significant differences between control mock and control
##                     Df Sum Sq Mean Sq F value   Pr(>F)    
## Condition            1  62845   62845  44.355 0.000288 ***
## Treatment            1   1229    1229   0.867 0.382707    
## Condition:Treatment  1      0       0   0.000 1.000000    
## Residuals            7   9918    1417                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Week 4
wk4.cont <- osmo %>% 
  filter(Treatment == "Control" | Treatment == "Control Mock") %>% 
  filter(Week == "Wk_4")

wk4.cont.aov <- aov(Osmolality ~ Condition * Treatment, data = wk4.cont)
summary(wk4.cont.aov) # no significant differences between control mock and control
##                     Df Sum Sq Mean Sq F value  Pr(>F)   
## Condition            1  85957   85957  19.207 0.00466 **
## Treatment            1   1562    1562   0.349 0.57617   
## Condition:Treatment  1   7370    7370   1.647 0.24672   
## Residuals            6  26852    4475                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Week 6
wk6.cont <- osmo %>% 
  filter(Treatment == "Control" | Treatment == "Control Mock") %>% 
  filter(Week == "Wk_6")

wk6.cont.aov <- aov(Osmolality ~ Condition * Treatment, data = wk6.cont)
summary(wk6.cont.aov) # no significant differences between control mock and control
##                     Df Sum Sq Mean Sq F value Pr(>F)  
## Condition            1  15110   15110   6.862 0.0344 *
## Treatment            1   3983    3983   1.809 0.2206  
## Condition:Treatment  1   1452    1452   0.659 0.4435  
## Residuals            7  15413    2202                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Week 8 
wk8.cont <- osmo %>% 
  filter(Treatment == "Control" | Treatment == "Control Mock") %>% 
  filter(Week == "Wk_8")

wk8.cont.aov <- aov(Osmolality ~ Condition * Treatment, data = wk8.cont)
summary(wk8.cont.aov) # no significant differences between control mock and control
##                     Df Sum Sq Mean Sq F value Pr(>F)
## Condition            1   8646    8646   1.371  0.307
## Treatment            1  15400   15400   2.442  0.193
## Condition:Treatment  1   5050    5050   0.801  0.421
## Residuals            4  25228    6307
# removing Control Mocks
osmo <- osmo %>% 
  filter(Treatment != "Control Mock")

Mean, SD, SE

osmo$Week[osmo$Week == "WK_8"] <- "Wk_8" # fixing spelling error 

osmo.sum <- osmo %>% 
  group_by(Week, Condition, Treatment) %>% 
  summarise(n = n(),
            mean = mean(Osmolality, na.rm = TRUE),
            sd = sd(Osmolality, na.rm = TRUE),
            se = sd(Osmolality, na.rm = TRUE)/sqrt(n()))
View(osmo.sum)

osmo.errobars <- ggplot(data = osmo.sum, aes(x = Treatment, y = mean, fill = Condition)) + geom_bar(stat = "identity", color = "black", position = position_dodge(0.9)) + geom_errorbar(aes(ymin = mean-sd, ymax = mean+sd), width = 0.2, position = position_dodge(0.9)) + facet_grid(. ~ Week)

osmo.errobars <- osmo.errobars + theme_bw() + scale_fill_manual(values=c("indianred3", "cadetblue3"), breaks=c("Well-watered", "Drought"),labels=c("Well-watered", "Drought")) + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank()) + theme(axis.title.x = element_blank()) + theme(axis.text.x = element_text(angle = 45, hjust = 1, vjust = 1)) + ylab(expression(Mean~Osmolality))

osmo.errobars
## Warning: Removed 1 rows containing missing values (geom_errorbar).

### ANOVAs #### Week 0

# Week 0
osmo.wk0 <- osmo %>% 
  filter(Week == "Wk_0")

# density histogram
ggplot(data = osmo.wk0, aes(x = Osmolality)) + geom_histogram(binwidth = 30, aes(y =..density..), colour = "black", fill = "white") + geom_density(alpha = 0.2, fill = "#FF6666") 

# by water treatment
osmo.wk0.mu <- osmo.wk0 %>% 
  group_by(Condition) %>% 
  summarise(mean = mean(Osmolality, na.rm = TRUE))

ggplot(data = osmo.wk0, aes(x = Osmolality, fill = Condition)) + geom_histogram(binwidth = 30, position = "identity", alpha = 0.5) + geom_vline(data = osmo.wk0.mu, aes(xintercept=mean, color=Condition), linetype="dashed") + scale_color_manual(values=c("indianred3", "cadetblue3")) + theme_classic() + xlab("Osmolality") + ylab("Count") + theme(legend.position = c(0.9, 0.9))

# ANOVA
osmo.wk0.aov <- aov(Osmolality ~ Condition * Treatment, data = osmo.wk0)
summary(osmo.wk0.aov)
##                     Df Sum Sq Mean Sq F value Pr(>F)
## Condition            1      6       6   0.002  0.969
## Treatment            4   7541    1885   0.480  0.750
## Condition:Treatment  4   8850    2212   0.563  0.692
## Residuals           21  82545    3931
# testing homogeneity of variances
plot(osmo.wk0.aov, 1)

leveneTest(Osmolality ~ Condition*Treatment, data = osmo.wk0) # p > 0.05 means no violation of homogeneity of varaince
# normality test
plot(osmo.wk0.aov, 2)

osmo.wk0.residuals <- residuals(object = osmo.wk0.aov)  # p > 0.05 means no violation of homogeneity of varaince
shapiro.test(x = osmo.wk0.residuals)
## 
##  Shapiro-Wilk normality test
## 
## data:  osmo.wk0.residuals
## W = 0.9629, p-value = 0.3475

Week 2

# Week 2 
wk2 <- osmo %>% 
  filter(Week == "Wk_2")

# ANOVA
wk2.aov <- aov(Osmolality ~ Condition * Treatment, data = wk2)
summary(wk2.aov)
##                     Df Sum Sq Mean Sq F value   Pr(>F)    
## Condition            1 116439  116439  37.792 5.25e-06 ***
## Treatment            4  19690    4923   1.598  0.21380    
## Condition:Treatment  4  62910   15728   5.105  0.00533 ** 
## Residuals           20  61621    3081                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Week 4

# Week 4
osmo.wk4 <- osmo %>% 
  filter(Week == "Wk_4")

# density histogram
ggplot(data = osmo.wk4, aes(x = Osmolality)) + geom_histogram(binwidth = 52, aes(y =..density..), colour = "black", fill = "white") + geom_density(alpha = 0.2, fill = "#FF6666") 

# by water treatment
osmo.wk4.mu <- osmo.wk4 %>% 
  group_by(Condition) %>% 
  summarise(mean = mean(Osmolality, na.rm = TRUE))

ggplot(data = osmo.wk4, aes(x = Osmolality, fill = Condition)) + geom_histogram(binwidth = 52, position = "identity", alpha = 0.5) + geom_vline(data = osmo.wk4.mu, aes(xintercept=mean, color=Condition), linetype="dashed") + scale_color_manual(values=c("indianred3", "cadetblue3")) + theme_classic() + xlab("Osmolality") + ylab("Count") + theme(legend.position = c(0.9, 0.9))

osmo.wk4.aov <- aov(Osmolality ~ Condition * Treatment, data = osmo.wk4)
summary(osmo.wk4.aov) # significant drought, microbial, and interaction term
##                     Df Sum Sq Mean Sq F value   Pr(>F)    
## Condition            1 214760  214760 123.827 6.09e-09 ***
## Treatment            4  42077   10519   6.065  0.00362 ** 
## Condition:Treatment  4  17167    4292   2.475  0.08611 .  
## Residuals           16  27750    1734                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
TukeyHSD(osmo.wk4.aov)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = Osmolality ~ Condition * Treatment, data = osmo.wk4)
## 
## $Condition
##                          diff     lwr      upr p adj
## Well-watered-Drought 181.7692 147.141 216.3974     0
## 
## $Treatment
##                                                   diff         lwr
## Control-All Isolates                        -35.123077 -112.381940
## Drought Isolates-All Isolates                96.205128    5.986213
## Nonfunctional Isolates-All Isolates         -36.500000 -110.163436
## Phosphorus Isolates-All Isolates             -8.000000  -81.663436
## Drought Isolates-Control                    131.328205   38.150510
## Nonfunctional Isolates-Control               -1.376923  -78.635787
## Phosphorus Isolates-Control                  27.123077  -50.135787
## Nonfunctional Isolates-Drought Isolates    -132.705128 -222.924044
## Phosphorus Isolates-Drought Isolates       -104.205128 -194.424044
## Phosphorus Isolates-Nonfunctional Isolates   28.500000  -45.163436
##                                                  upr     p adj
## Control-All Isolates                        42.13579 0.6405864
## Drought Isolates-All Isolates              186.42404 0.0337916
## Nonfunctional Isolates-All Isolates         37.16344 0.5661953
## Phosphorus Isolates-All Isolates            65.66344 0.9970701
## Drought Isolates-Control                   224.50590 0.0041556
## Nonfunctional Isolates-Control              75.88194 0.9999977
## Phosphorus Isolates-Control                104.38194 0.8161977
## Nonfunctional Isolates-Drought Isolates    -42.48621 0.0028489
## Phosphorus Isolates-Drought Isolates       -13.98621 0.0198071
## Phosphorus Isolates-Nonfunctional Isolates 102.16344 0.7594089
## 
## $`Condition:Treatment`
##                                                                             diff
## Well-watered:All Isolates-Drought:All Isolates                        193.000000
## Drought:Control-Drought:All Isolates                                  -10.333333
## Well-watered:Control-Drought:All Isolates                             123.500000
## Drought:Drought Isolates-Drought:All Isolates                         153.000000
## Well-watered:Drought Isolates-Drought:All Isolates                    258.000000
## Drought:Nonfunctional Isolates-Drought:All Isolates                    -5.333333
## Well-watered:Nonfunctional Isolates-Drought:All Isolates              125.333333
## Drought:Phosphorus Isolates-Drought:All Isolates                      -36.666667
## Well-watered:Phosphorus Isolates-Drought:All Isolates                 213.666667
## Drought:Control-Well-watered:All Isolates                            -203.333333
## Well-watered:Control-Well-watered:All Isolates                        -69.500000
## Drought:Drought Isolates-Well-watered:All Isolates                    -40.000000
## Well-watered:Drought Isolates-Well-watered:All Isolates                65.000000
## Drought:Nonfunctional Isolates-Well-watered:All Isolates             -198.333333
## Well-watered:Nonfunctional Isolates-Well-watered:All Isolates         -67.666667
## Drought:Phosphorus Isolates-Well-watered:All Isolates                -229.666667
## Well-watered:Phosphorus Isolates-Well-watered:All Isolates             20.666667
## Well-watered:Control-Drought:Control                                  133.833333
## Drought:Drought Isolates-Drought:Control                              163.333333
## Well-watered:Drought Isolates-Drought:Control                         268.333333
## Drought:Nonfunctional Isolates-Drought:Control                          5.000000
## Well-watered:Nonfunctional Isolates-Drought:Control                   135.666667
## Drought:Phosphorus Isolates-Drought:Control                           -26.333333
## Well-watered:Phosphorus Isolates-Drought:Control                      224.000000
## Drought:Drought Isolates-Well-watered:Control                          29.500000
## Well-watered:Drought Isolates-Well-watered:Control                    134.500000
## Drought:Nonfunctional Isolates-Well-watered:Control                  -128.833333
## Well-watered:Nonfunctional Isolates-Well-watered:Control                1.833333
## Drought:Phosphorus Isolates-Well-watered:Control                     -160.166667
## Well-watered:Phosphorus Isolates-Well-watered:Control                  90.166667
## Well-watered:Drought Isolates-Drought:Drought Isolates                105.000000
## Drought:Nonfunctional Isolates-Drought:Drought Isolates              -158.333333
## Well-watered:Nonfunctional Isolates-Drought:Drought Isolates          -27.666667
## Drought:Phosphorus Isolates-Drought:Drought Isolates                 -189.666667
## Well-watered:Phosphorus Isolates-Drought:Drought Isolates              60.666667
## Drought:Nonfunctional Isolates-Well-watered:Drought Isolates         -263.333333
## Well-watered:Nonfunctional Isolates-Well-watered:Drought Isolates    -132.666667
## Drought:Phosphorus Isolates-Well-watered:Drought Isolates            -294.666667
## Well-watered:Phosphorus Isolates-Well-watered:Drought Isolates        -44.333333
## Well-watered:Nonfunctional Isolates-Drought:Nonfunctional Isolates    130.666667
## Drought:Phosphorus Isolates-Drought:Nonfunctional Isolates            -31.333333
## Well-watered:Phosphorus Isolates-Drought:Nonfunctional Isolates       219.000000
## Drought:Phosphorus Isolates-Well-watered:Nonfunctional Isolates      -162.000000
## Well-watered:Phosphorus Isolates-Well-watered:Nonfunctional Isolates   88.333333
## Well-watered:Phosphorus Isolates-Drought:Phosphorus Isolates          250.333333
##                                                                              lwr
## Well-watered:All Isolates-Drought:All Isolates                         69.177608
## Drought:Control-Drought:All Isolates                                 -134.155725
## Well-watered:Control-Drought:All Isolates                             -14.937642
## Drought:Drought Isolates-Drought:All Isolates                         -22.111306
## Well-watered:Drought Isolates-Drought:All Isolates                    119.562358
## Drought:Nonfunctional Isolates-Drought:All Isolates                  -129.155725
## Well-watered:Nonfunctional Isolates-Drought:All Isolates                1.510942
## Drought:Phosphorus Isolates-Drought:All Isolates                     -160.489058
## Well-watered:Phosphorus Isolates-Drought:All Isolates                  89.844275
## Drought:Control-Well-watered:All Isolates                            -327.155725
## Well-watered:Control-Well-watered:All Isolates                       -207.937642
## Drought:Drought Isolates-Well-watered:All Isolates                   -215.111306
## Well-watered:Drought Isolates-Well-watered:All Isolates               -73.437642
## Drought:Nonfunctional Isolates-Well-watered:All Isolates             -322.155725
## Well-watered:Nonfunctional Isolates-Well-watered:All Isolates        -191.489058
## Drought:Phosphorus Isolates-Well-watered:All Isolates                -353.489058
## Well-watered:Phosphorus Isolates-Well-watered:All Isolates           -103.155725
## Well-watered:Control-Drought:Control                                   -4.604309
## Drought:Drought Isolates-Drought:Control                              -11.777972
## Well-watered:Drought Isolates-Drought:Control                         129.895691
## Drought:Nonfunctional Isolates-Drought:Control                       -118.822392
## Well-watered:Nonfunctional Isolates-Drought:Control                    11.844275
## Drought:Phosphorus Isolates-Drought:Control                          -150.155725
## Well-watered:Phosphorus Isolates-Drought:Control                      100.177608
## Drought:Drought Isolates-Well-watered:Control                        -156.233587
## Well-watered:Drought Isolates-Well-watered:Control                    -17.150839
## Drought:Nonfunctional Isolates-Well-watered:Control                  -267.270976
## Well-watered:Nonfunctional Isolates-Well-watered:Control             -136.604309
## Drought:Phosphorus Isolates-Well-watered:Control                     -298.604309
## Well-watered:Phosphorus Isolates-Well-watered:Control                 -48.270976
## Well-watered:Drought Isolates-Drought:Drought Isolates                -80.733587
## Drought:Nonfunctional Isolates-Drought:Drought Isolates              -333.444639
## Well-watered:Nonfunctional Isolates-Drought:Drought Isolates         -202.777972
## Drought:Phosphorus Isolates-Drought:Drought Isolates                 -364.777972
## Well-watered:Phosphorus Isolates-Drought:Drought Isolates            -114.444639
## Drought:Nonfunctional Isolates-Well-watered:Drought Isolates         -401.770976
## Well-watered:Nonfunctional Isolates-Well-watered:Drought Isolates    -271.104309
## Drought:Phosphorus Isolates-Well-watered:Drought Isolates            -433.104309
## Well-watered:Phosphorus Isolates-Well-watered:Drought Isolates       -182.770976
## Well-watered:Nonfunctional Isolates-Drought:Nonfunctional Isolates      6.844275
## Drought:Phosphorus Isolates-Drought:Nonfunctional Isolates           -155.155725
## Well-watered:Phosphorus Isolates-Drought:Nonfunctional Isolates        95.177608
## Drought:Phosphorus Isolates-Well-watered:Nonfunctional Isolates      -285.822392
## Well-watered:Phosphorus Isolates-Well-watered:Nonfunctional Isolates  -35.489058
## Well-watered:Phosphorus Isolates-Drought:Phosphorus Isolates          126.510942
##                                                                              upr
## Well-watered:All Isolates-Drought:All Isolates                        316.822392
## Drought:Control-Drought:All Isolates                                  113.489058
## Well-watered:Control-Drought:All Isolates                             261.937642
## Drought:Drought Isolates-Drought:All Isolates                         328.111306
## Well-watered:Drought Isolates-Drought:All Isolates                    396.437642
## Drought:Nonfunctional Isolates-Drought:All Isolates                   118.489058
## Well-watered:Nonfunctional Isolates-Drought:All Isolates              249.155725
## Drought:Phosphorus Isolates-Drought:All Isolates                       87.155725
## Well-watered:Phosphorus Isolates-Drought:All Isolates                 337.489058
## Drought:Control-Well-watered:All Isolates                             -79.510942
## Well-watered:Control-Well-watered:All Isolates                         68.937642
## Drought:Drought Isolates-Well-watered:All Isolates                    135.111306
## Well-watered:Drought Isolates-Well-watered:All Isolates               203.437642
## Drought:Nonfunctional Isolates-Well-watered:All Isolates              -74.510942
## Well-watered:Nonfunctional Isolates-Well-watered:All Isolates          56.155725
## Drought:Phosphorus Isolates-Well-watered:All Isolates                -105.844275
## Well-watered:Phosphorus Isolates-Well-watered:All Isolates            144.489058
## Well-watered:Control-Drought:Control                                  272.270976
## Drought:Drought Isolates-Drought:Control                              338.444639
## Well-watered:Drought Isolates-Drought:Control                         406.770976
## Drought:Nonfunctional Isolates-Drought:Control                        128.822392
## Well-watered:Nonfunctional Isolates-Drought:Control                   259.489058
## Drought:Phosphorus Isolates-Drought:Control                            97.489058
## Well-watered:Phosphorus Isolates-Drought:Control                      347.822392
## Drought:Drought Isolates-Well-watered:Control                         215.233587
## Well-watered:Drought Isolates-Well-watered:Control                    286.150839
## Drought:Nonfunctional Isolates-Well-watered:Control                     9.604309
## Well-watered:Nonfunctional Isolates-Well-watered:Control              140.270976
## Drought:Phosphorus Isolates-Well-watered:Control                      -21.729024
## Well-watered:Phosphorus Isolates-Well-watered:Control                 228.604309
## Well-watered:Drought Isolates-Drought:Drought Isolates                290.733587
## Drought:Nonfunctional Isolates-Drought:Drought Isolates                16.777972
## Well-watered:Nonfunctional Isolates-Drought:Drought Isolates          147.444639
## Drought:Phosphorus Isolates-Drought:Drought Isolates                  -14.555361
## Well-watered:Phosphorus Isolates-Drought:Drought Isolates             235.777972
## Drought:Nonfunctional Isolates-Well-watered:Drought Isolates         -124.895691
## Well-watered:Nonfunctional Isolates-Well-watered:Drought Isolates       5.770976
## Drought:Phosphorus Isolates-Well-watered:Drought Isolates            -156.229024
## Well-watered:Phosphorus Isolates-Well-watered:Drought Isolates         94.104309
## Well-watered:Nonfunctional Isolates-Drought:Nonfunctional Isolates    254.489058
## Drought:Phosphorus Isolates-Drought:Nonfunctional Isolates             92.489058
## Well-watered:Phosphorus Isolates-Drought:Nonfunctional Isolates       342.822392
## Drought:Phosphorus Isolates-Well-watered:Nonfunctional Isolates       -38.177608
## Well-watered:Phosphorus Isolates-Well-watered:Nonfunctional Isolates  212.155725
## Well-watered:Phosphorus Isolates-Drought:Phosphorus Isolates          374.155725
##                                                                          p adj
## Well-watered:All Isolates-Drought:All Isolates                       0.0010483
## Drought:Control-Drought:All Isolates                                 0.9999992
## Well-watered:Control-Drought:All Isolates                            0.1017466
## Drought:Drought Isolates-Drought:All Isolates                        0.1143441
## Well-watered:Drought Isolates-Drought:All Isolates                   0.0001417
## Drought:Nonfunctional Isolates-Drought:All Isolates                  1.0000000
## Well-watered:Nonfunctional Isolates-Drought:All Isolates             0.0460426
## Drought:Phosphorus Isolates-Drought:All Isolates                     0.9802717
## Well-watered:Phosphorus Isolates-Drought:All Isolates                0.0003449
## Drought:Control-Well-watered:All Isolates                            0.0005984
## Well-watered:Control-Well-watered:All Isolates                       0.7110510
## Drought:Drought Isolates-Well-watered:All Isolates                   0.9966917
## Well-watered:Drought Isolates-Well-watered:All Isolates              0.7759432
## Drought:Nonfunctional Isolates-Well-watered:All Isolates             0.0007840
## Well-watered:Nonfunctional Isolates-Well-watered:All Isolates        0.6164630
## Drought:Phosphorus Isolates-Well-watered:All Isolates                0.0001499
## Well-watered:Phosphorus Isolates-Well-watered:All Isolates           0.9997052
## Well-watered:Control-Drought:Control                                 0.0624818
## Drought:Drought Isolates-Drought:Control                             0.0782095
## Well-watered:Drought Isolates-Drought:Control                        0.0000887
## Drought:Nonfunctional Isolates-Drought:Control                       1.0000000
## Well-watered:Nonfunctional Isolates-Drought:Control                  0.0259965
## Drought:Phosphorus Isolates-Drought:Control                          0.9980522
## Well-watered:Phosphorus Isolates-Drought:Control                     0.0002008
## Drought:Drought Isolates-Well-watered:Control                        0.9998025
## Well-watered:Drought Isolates-Well-watered:Control                   0.1051756
## Drought:Nonfunctional Isolates-Well-watered:Control                  0.0793003
## Well-watered:Nonfunctional Isolates-Well-watered:Control             1.0000000
## Drought:Phosphorus Isolates-Well-watered:Control                     0.0169822
## Well-watered:Phosphorus Isolates-Well-watered:Control                0.3994380
## Well-watered:Drought Isolates-Drought:Drought Isolates               0.5757429
## Drought:Nonfunctional Isolates-Drought:Drought Isolates              0.0941504
## Well-watered:Nonfunctional Isolates-Drought:Drought Isolates         0.9998108
## Drought:Phosphorus Isolates-Drought:Drought Isolates                 0.0283471
## Well-watered:Phosphorus Isolates-Drought:Drought Isolates            0.9490213
## Drought:Nonfunctional Isolates-Well-watered:Drought Isolates         0.0001112
## Well-watered:Nonfunctional Isolates-Well-watered:Drought Isolates    0.0660794
## Drought:Phosphorus Isolates-Well-watered:Drought Isolates            0.0000280
## Well-watered:Phosphorus Isolates-Well-watered:Drought Isolates       0.9678755
## Well-watered:Nonfunctional Isolates-Drought:Nonfunctional Isolates   0.0343302
## Drought:Phosphorus Isolates-Drought:Nonfunctional Isolates           0.9931191
## Well-watered:Phosphorus Isolates-Drought:Nonfunctional Isolates      0.0002605
## Drought:Phosphorus Isolates-Well-watered:Nonfunctional Isolates      0.0058933
## Well-watered:Phosphorus Isolates-Well-watered:Nonfunctional Isolates 0.2925005
## Well-watered:Phosphorus Isolates-Drought:Phosphorus Isolates         0.0000531
# ANOVA
osmo.wk4.aov <- aov(Osmolality ~ Condition * Treatment, data = osmo.wk4)
summary(osmo.wk4.aov) # significant drought, microbial, and interaction term
##                     Df Sum Sq Mean Sq F value   Pr(>F)    
## Condition            1 214760  214760 123.827 6.09e-09 ***
## Treatment            4  42077   10519   6.065  0.00362 ** 
## Condition:Treatment  4  17167    4292   2.475  0.08611 .  
## Residuals           16  27750    1734                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
TukeyHSD(osmo.wk4.aov)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = Osmolality ~ Condition * Treatment, data = osmo.wk4)
## 
## $Condition
##                          diff     lwr      upr p adj
## Well-watered-Drought 181.7692 147.141 216.3974     0
## 
## $Treatment
##                                                   diff         lwr
## Control-All Isolates                        -35.123077 -112.381940
## Drought Isolates-All Isolates                96.205128    5.986213
## Nonfunctional Isolates-All Isolates         -36.500000 -110.163436
## Phosphorus Isolates-All Isolates             -8.000000  -81.663436
## Drought Isolates-Control                    131.328205   38.150510
## Nonfunctional Isolates-Control               -1.376923  -78.635787
## Phosphorus Isolates-Control                  27.123077  -50.135787
## Nonfunctional Isolates-Drought Isolates    -132.705128 -222.924044
## Phosphorus Isolates-Drought Isolates       -104.205128 -194.424044
## Phosphorus Isolates-Nonfunctional Isolates   28.500000  -45.163436
##                                                  upr     p adj
## Control-All Isolates                        42.13579 0.6405864
## Drought Isolates-All Isolates              186.42404 0.0337916
## Nonfunctional Isolates-All Isolates         37.16344 0.5661953
## Phosphorus Isolates-All Isolates            65.66344 0.9970701
## Drought Isolates-Control                   224.50590 0.0041556
## Nonfunctional Isolates-Control              75.88194 0.9999977
## Phosphorus Isolates-Control                104.38194 0.8161977
## Nonfunctional Isolates-Drought Isolates    -42.48621 0.0028489
## Phosphorus Isolates-Drought Isolates       -13.98621 0.0198071
## Phosphorus Isolates-Nonfunctional Isolates 102.16344 0.7594089
## 
## $`Condition:Treatment`
##                                                                             diff
## Well-watered:All Isolates-Drought:All Isolates                        193.000000
## Drought:Control-Drought:All Isolates                                  -10.333333
## Well-watered:Control-Drought:All Isolates                             123.500000
## Drought:Drought Isolates-Drought:All Isolates                         153.000000
## Well-watered:Drought Isolates-Drought:All Isolates                    258.000000
## Drought:Nonfunctional Isolates-Drought:All Isolates                    -5.333333
## Well-watered:Nonfunctional Isolates-Drought:All Isolates              125.333333
## Drought:Phosphorus Isolates-Drought:All Isolates                      -36.666667
## Well-watered:Phosphorus Isolates-Drought:All Isolates                 213.666667
## Drought:Control-Well-watered:All Isolates                            -203.333333
## Well-watered:Control-Well-watered:All Isolates                        -69.500000
## Drought:Drought Isolates-Well-watered:All Isolates                    -40.000000
## Well-watered:Drought Isolates-Well-watered:All Isolates                65.000000
## Drought:Nonfunctional Isolates-Well-watered:All Isolates             -198.333333
## Well-watered:Nonfunctional Isolates-Well-watered:All Isolates         -67.666667
## Drought:Phosphorus Isolates-Well-watered:All Isolates                -229.666667
## Well-watered:Phosphorus Isolates-Well-watered:All Isolates             20.666667
## Well-watered:Control-Drought:Control                                  133.833333
## Drought:Drought Isolates-Drought:Control                              163.333333
## Well-watered:Drought Isolates-Drought:Control                         268.333333
## Drought:Nonfunctional Isolates-Drought:Control                          5.000000
## Well-watered:Nonfunctional Isolates-Drought:Control                   135.666667
## Drought:Phosphorus Isolates-Drought:Control                           -26.333333
## Well-watered:Phosphorus Isolates-Drought:Control                      224.000000
## Drought:Drought Isolates-Well-watered:Control                          29.500000
## Well-watered:Drought Isolates-Well-watered:Control                    134.500000
## Drought:Nonfunctional Isolates-Well-watered:Control                  -128.833333
## Well-watered:Nonfunctional Isolates-Well-watered:Control                1.833333
## Drought:Phosphorus Isolates-Well-watered:Control                     -160.166667
## Well-watered:Phosphorus Isolates-Well-watered:Control                  90.166667
## Well-watered:Drought Isolates-Drought:Drought Isolates                105.000000
## Drought:Nonfunctional Isolates-Drought:Drought Isolates              -158.333333
## Well-watered:Nonfunctional Isolates-Drought:Drought Isolates          -27.666667
## Drought:Phosphorus Isolates-Drought:Drought Isolates                 -189.666667
## Well-watered:Phosphorus Isolates-Drought:Drought Isolates              60.666667
## Drought:Nonfunctional Isolates-Well-watered:Drought Isolates         -263.333333
## Well-watered:Nonfunctional Isolates-Well-watered:Drought Isolates    -132.666667
## Drought:Phosphorus Isolates-Well-watered:Drought Isolates            -294.666667
## Well-watered:Phosphorus Isolates-Well-watered:Drought Isolates        -44.333333
## Well-watered:Nonfunctional Isolates-Drought:Nonfunctional Isolates    130.666667
## Drought:Phosphorus Isolates-Drought:Nonfunctional Isolates            -31.333333
## Well-watered:Phosphorus Isolates-Drought:Nonfunctional Isolates       219.000000
## Drought:Phosphorus Isolates-Well-watered:Nonfunctional Isolates      -162.000000
## Well-watered:Phosphorus Isolates-Well-watered:Nonfunctional Isolates   88.333333
## Well-watered:Phosphorus Isolates-Drought:Phosphorus Isolates          250.333333
##                                                                              lwr
## Well-watered:All Isolates-Drought:All Isolates                         69.177608
## Drought:Control-Drought:All Isolates                                 -134.155725
## Well-watered:Control-Drought:All Isolates                             -14.937642
## Drought:Drought Isolates-Drought:All Isolates                         -22.111306
## Well-watered:Drought Isolates-Drought:All Isolates                    119.562358
## Drought:Nonfunctional Isolates-Drought:All Isolates                  -129.155725
## Well-watered:Nonfunctional Isolates-Drought:All Isolates                1.510942
## Drought:Phosphorus Isolates-Drought:All Isolates                     -160.489058
## Well-watered:Phosphorus Isolates-Drought:All Isolates                  89.844275
## Drought:Control-Well-watered:All Isolates                            -327.155725
## Well-watered:Control-Well-watered:All Isolates                       -207.937642
## Drought:Drought Isolates-Well-watered:All Isolates                   -215.111306
## Well-watered:Drought Isolates-Well-watered:All Isolates               -73.437642
## Drought:Nonfunctional Isolates-Well-watered:All Isolates             -322.155725
## Well-watered:Nonfunctional Isolates-Well-watered:All Isolates        -191.489058
## Drought:Phosphorus Isolates-Well-watered:All Isolates                -353.489058
## Well-watered:Phosphorus Isolates-Well-watered:All Isolates           -103.155725
## Well-watered:Control-Drought:Control                                   -4.604309
## Drought:Drought Isolates-Drought:Control                              -11.777972
## Well-watered:Drought Isolates-Drought:Control                         129.895691
## Drought:Nonfunctional Isolates-Drought:Control                       -118.822392
## Well-watered:Nonfunctional Isolates-Drought:Control                    11.844275
## Drought:Phosphorus Isolates-Drought:Control                          -150.155725
## Well-watered:Phosphorus Isolates-Drought:Control                      100.177608
## Drought:Drought Isolates-Well-watered:Control                        -156.233587
## Well-watered:Drought Isolates-Well-watered:Control                    -17.150839
## Drought:Nonfunctional Isolates-Well-watered:Control                  -267.270976
## Well-watered:Nonfunctional Isolates-Well-watered:Control             -136.604309
## Drought:Phosphorus Isolates-Well-watered:Control                     -298.604309
## Well-watered:Phosphorus Isolates-Well-watered:Control                 -48.270976
## Well-watered:Drought Isolates-Drought:Drought Isolates                -80.733587
## Drought:Nonfunctional Isolates-Drought:Drought Isolates              -333.444639
## Well-watered:Nonfunctional Isolates-Drought:Drought Isolates         -202.777972
## Drought:Phosphorus Isolates-Drought:Drought Isolates                 -364.777972
## Well-watered:Phosphorus Isolates-Drought:Drought Isolates            -114.444639
## Drought:Nonfunctional Isolates-Well-watered:Drought Isolates         -401.770976
## Well-watered:Nonfunctional Isolates-Well-watered:Drought Isolates    -271.104309
## Drought:Phosphorus Isolates-Well-watered:Drought Isolates            -433.104309
## Well-watered:Phosphorus Isolates-Well-watered:Drought Isolates       -182.770976
## Well-watered:Nonfunctional Isolates-Drought:Nonfunctional Isolates      6.844275
## Drought:Phosphorus Isolates-Drought:Nonfunctional Isolates           -155.155725
## Well-watered:Phosphorus Isolates-Drought:Nonfunctional Isolates        95.177608
## Drought:Phosphorus Isolates-Well-watered:Nonfunctional Isolates      -285.822392
## Well-watered:Phosphorus Isolates-Well-watered:Nonfunctional Isolates  -35.489058
## Well-watered:Phosphorus Isolates-Drought:Phosphorus Isolates          126.510942
##                                                                              upr
## Well-watered:All Isolates-Drought:All Isolates                        316.822392
## Drought:Control-Drought:All Isolates                                  113.489058
## Well-watered:Control-Drought:All Isolates                             261.937642
## Drought:Drought Isolates-Drought:All Isolates                         328.111306
## Well-watered:Drought Isolates-Drought:All Isolates                    396.437642
## Drought:Nonfunctional Isolates-Drought:All Isolates                   118.489058
## Well-watered:Nonfunctional Isolates-Drought:All Isolates              249.155725
## Drought:Phosphorus Isolates-Drought:All Isolates                       87.155725
## Well-watered:Phosphorus Isolates-Drought:All Isolates                 337.489058
## Drought:Control-Well-watered:All Isolates                             -79.510942
## Well-watered:Control-Well-watered:All Isolates                         68.937642
## Drought:Drought Isolates-Well-watered:All Isolates                    135.111306
## Well-watered:Drought Isolates-Well-watered:All Isolates               203.437642
## Drought:Nonfunctional Isolates-Well-watered:All Isolates              -74.510942
## Well-watered:Nonfunctional Isolates-Well-watered:All Isolates          56.155725
## Drought:Phosphorus Isolates-Well-watered:All Isolates                -105.844275
## Well-watered:Phosphorus Isolates-Well-watered:All Isolates            144.489058
## Well-watered:Control-Drought:Control                                  272.270976
## Drought:Drought Isolates-Drought:Control                              338.444639
## Well-watered:Drought Isolates-Drought:Control                         406.770976
## Drought:Nonfunctional Isolates-Drought:Control                        128.822392
## Well-watered:Nonfunctional Isolates-Drought:Control                   259.489058
## Drought:Phosphorus Isolates-Drought:Control                            97.489058
## Well-watered:Phosphorus Isolates-Drought:Control                      347.822392
## Drought:Drought Isolates-Well-watered:Control                         215.233587
## Well-watered:Drought Isolates-Well-watered:Control                    286.150839
## Drought:Nonfunctional Isolates-Well-watered:Control                     9.604309
## Well-watered:Nonfunctional Isolates-Well-watered:Control              140.270976
## Drought:Phosphorus Isolates-Well-watered:Control                      -21.729024
## Well-watered:Phosphorus Isolates-Well-watered:Control                 228.604309
## Well-watered:Drought Isolates-Drought:Drought Isolates                290.733587
## Drought:Nonfunctional Isolates-Drought:Drought Isolates                16.777972
## Well-watered:Nonfunctional Isolates-Drought:Drought Isolates          147.444639
## Drought:Phosphorus Isolates-Drought:Drought Isolates                  -14.555361
## Well-watered:Phosphorus Isolates-Drought:Drought Isolates             235.777972
## Drought:Nonfunctional Isolates-Well-watered:Drought Isolates         -124.895691
## Well-watered:Nonfunctional Isolates-Well-watered:Drought Isolates       5.770976
## Drought:Phosphorus Isolates-Well-watered:Drought Isolates            -156.229024
## Well-watered:Phosphorus Isolates-Well-watered:Drought Isolates         94.104309
## Well-watered:Nonfunctional Isolates-Drought:Nonfunctional Isolates    254.489058
## Drought:Phosphorus Isolates-Drought:Nonfunctional Isolates             92.489058
## Well-watered:Phosphorus Isolates-Drought:Nonfunctional Isolates       342.822392
## Drought:Phosphorus Isolates-Well-watered:Nonfunctional Isolates       -38.177608
## Well-watered:Phosphorus Isolates-Well-watered:Nonfunctional Isolates  212.155725
## Well-watered:Phosphorus Isolates-Drought:Phosphorus Isolates          374.155725
##                                                                          p adj
## Well-watered:All Isolates-Drought:All Isolates                       0.0010483
## Drought:Control-Drought:All Isolates                                 0.9999992
## Well-watered:Control-Drought:All Isolates                            0.1017466
## Drought:Drought Isolates-Drought:All Isolates                        0.1143441
## Well-watered:Drought Isolates-Drought:All Isolates                   0.0001417
## Drought:Nonfunctional Isolates-Drought:All Isolates                  1.0000000
## Well-watered:Nonfunctional Isolates-Drought:All Isolates             0.0460426
## Drought:Phosphorus Isolates-Drought:All Isolates                     0.9802717
## Well-watered:Phosphorus Isolates-Drought:All Isolates                0.0003449
## Drought:Control-Well-watered:All Isolates                            0.0005984
## Well-watered:Control-Well-watered:All Isolates                       0.7110510
## Drought:Drought Isolates-Well-watered:All Isolates                   0.9966917
## Well-watered:Drought Isolates-Well-watered:All Isolates              0.7759432
## Drought:Nonfunctional Isolates-Well-watered:All Isolates             0.0007840
## Well-watered:Nonfunctional Isolates-Well-watered:All Isolates        0.6164630
## Drought:Phosphorus Isolates-Well-watered:All Isolates                0.0001499
## Well-watered:Phosphorus Isolates-Well-watered:All Isolates           0.9997052
## Well-watered:Control-Drought:Control                                 0.0624818
## Drought:Drought Isolates-Drought:Control                             0.0782095
## Well-watered:Drought Isolates-Drought:Control                        0.0000887
## Drought:Nonfunctional Isolates-Drought:Control                       1.0000000
## Well-watered:Nonfunctional Isolates-Drought:Control                  0.0259965
## Drought:Phosphorus Isolates-Drought:Control                          0.9980522
## Well-watered:Phosphorus Isolates-Drought:Control                     0.0002008
## Drought:Drought Isolates-Well-watered:Control                        0.9998025
## Well-watered:Drought Isolates-Well-watered:Control                   0.1051756
## Drought:Nonfunctional Isolates-Well-watered:Control                  0.0793003
## Well-watered:Nonfunctional Isolates-Well-watered:Control             1.0000000
## Drought:Phosphorus Isolates-Well-watered:Control                     0.0169822
## Well-watered:Phosphorus Isolates-Well-watered:Control                0.3994380
## Well-watered:Drought Isolates-Drought:Drought Isolates               0.5757429
## Drought:Nonfunctional Isolates-Drought:Drought Isolates              0.0941504
## Well-watered:Nonfunctional Isolates-Drought:Drought Isolates         0.9998108
## Drought:Phosphorus Isolates-Drought:Drought Isolates                 0.0283471
## Well-watered:Phosphorus Isolates-Drought:Drought Isolates            0.9490213
## Drought:Nonfunctional Isolates-Well-watered:Drought Isolates         0.0001112
## Well-watered:Nonfunctional Isolates-Well-watered:Drought Isolates    0.0660794
## Drought:Phosphorus Isolates-Well-watered:Drought Isolates            0.0000280
## Well-watered:Phosphorus Isolates-Well-watered:Drought Isolates       0.9678755
## Well-watered:Nonfunctional Isolates-Drought:Nonfunctional Isolates   0.0343302
## Drought:Phosphorus Isolates-Drought:Nonfunctional Isolates           0.9931191
## Well-watered:Phosphorus Isolates-Drought:Nonfunctional Isolates      0.0002605
## Drought:Phosphorus Isolates-Well-watered:Nonfunctional Isolates      0.0058933
## Well-watered:Phosphorus Isolates-Well-watered:Nonfunctional Isolates 0.2925005
## Well-watered:Phosphorus Isolates-Drought:Phosphorus Isolates         0.0000531
# testing homogeneity of variances
plot(osmo.wk4.aov, 1)

leveneTest(Osmolality ~ Condition*Treatment, data = osmo.wk4)
# normality test
plot(osmo.wk4.aov, 2)
## Warning: not plotting observations with leverage one:
##   7

osmo.wk4.residuals <- residuals(object = osmo.wk4.aov)
shapiro.test(x = osmo.wk4.residuals)
## 
##  Shapiro-Wilk normality test
## 
## data:  osmo.wk4.residuals
## W = 0.97679, p-value = 0.7996

Week 6

# Week 6
wk6 <- osmo %>% 
  filter(Week == "Wk_6")

# ANOVA
wk6.aov <- aov(Osmolality ~ Condition * Treatment, data = wk6)
summary(wk6.aov) 
##                     Df Sum Sq Mean Sq F value   Pr(>F)    
## Condition            1  89653   89653  31.968 1.56e-05 ***
## Treatment            4   8888    2222   0.792    0.544    
## Condition:Treatment  4  18070    4518   1.611    0.211    
## Residuals           20  56090    2804                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Week 8

# Week 8
osmo.wk8 <- osmo %>% 
  filter(Week == "Wk_8")

# density histogram
ggplot(data = osmo.wk8, aes(x = Osmolality)) + geom_histogram(binwidth = 110, aes(y =..density..), colour = "black", fill = "white") + geom_density(alpha = 0.2, fill = "#FF6666") 

# by water treatment
osmo.wk8.mu <- osmo.wk8 %>% 
  group_by(Condition) %>% 
  summarise(mean = mean(Osmolality, na.rm = TRUE))

ggplot(data = osmo.wk8, aes(x = Osmolality, fill = Condition)) + geom_histogram(binwidth = 110, position = "identity", alpha = 0.5) + geom_vline(data = osmo.wk8.mu, aes(xintercept=mean, color=Condition), linetype="dashed") + scale_color_manual(values=c("indianred3", "cadetblue3")) + theme_classic() + xlab("Osmolality") + ylab("Count") + theme(legend.position = c(0.9, 0.9))

# ANOVA
osmo.wk8.aov <- aov(Osmolality ~ Condition * Treatment, data = osmo.wk8)
summary(osmo.wk8.aov)
##                     Df Sum Sq Mean Sq F value Pr(>F)   
## Condition            1  30958   30958   5.718 0.0258 * 
## Treatment            4 123800   30950   5.717 0.0026 **
## Condition:Treatment  4  74910   18727   3.459 0.0245 * 
## Residuals           22 119104    5414                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# testing homogeneity of variances
plot(osmo.wk8.aov, 1)

leveneTest(Osmolality ~ Condition*Treatment, data = osmo.wk8) # p < 0.05 means violation of homogeneity of varaince
# normality test
plot(osmo.wk8.aov, 2)

osmo.wk8.residuals <- residuals(object = osmo.wk8.aov)  # p > 0.05 means no violation of homogeneity of varaince
shapiro.test(x = osmo.wk8.residuals)
## 
##  Shapiro-Wilk normality test
## 
## data:  osmo.wk8.residuals
## W = 0.97035, p-value = 0.5091